]> iEval git - app-musicexpo.git/blobdiff - lib/App/MusicExpo.pm
Order JSON song list by title (same order as HTML table)
[app-musicexpo.git] / lib / App / MusicExpo.pm
index bf7707078223a04698aba63923e7d5e1b0b9a64a..dd3e57565591620d7ab4ff9070e308618f3d1bf0 100644 (file)
@@ -163,10 +163,11 @@ sub run {
                push @files, \%entry
        }
 
+       @files = sort { $a->{title} cmp $b->{title} } @files;
        my $json = JSON::MaybeXS->new(canonical => 1)->encode({files => \@files, prefix => $prefix});
        $json =~ s/</&lt;/g;
        $json =~ s/>/&gt;/g;
-       $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files], prefix => $prefix, json => $json);
+       $ht->param(files => \@files, prefix => $prefix, json => $json);
        print $ht->output;
 }
 
@@ -175,6 +176,9 @@ $default_template = <<'HTML';
 <title>Music</title>
 <meta charset="utf-8">
 <link rel="stylesheet" href="/music.css">
+<script async defer type="application/javascript" src="player.js"></script>
+
+<div id="player"></div>
 
 <table border>
 <thead>
This page took 0.021727 seconds and 4 git commands to generate.