projects
/
app-musicexpo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use fragments for music player to allow linking
[app-musicexpo.git]
/
lib
/
App
/
MusicExpo.pm
diff --git
a/lib/App/MusicExpo.pm
b/lib/App/MusicExpo.pm
index 4ff61baaa9d548494a75433d87f74aa21522f796..c38d2b7f7b22ff56e6e884ab94be428f233f76a4 100644
(file)
--- a/
lib/App/MusicExpo.pm
+++ b/
lib/App/MusicExpo.pm
@@
-123,6
+123,8
@@
sub normalizer{
"$_[0]|".(stat $_[0])[9]
}
"$_[0]|".(stat $_[0])[9]
}
+sub make_fragment{ join '-', map { lc =~ y/a-z0-9/_/csr } @_ }
+
sub run {
if ($cache) {
tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644;
sub run {
if ($cache) {
tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644;
@@
-159,6
+161,7
@@
sub run {
}
}
delete $entry{$_} for qw/format file/;
}
}
delete $entry{$_} for qw/format file/;
+ $entry{fragment} = make_fragment @entry{qw/artist title/};
push @files, \%entry
}
push @files, \%entry
}
@@
-180,7
+183,7
@@
$default_template = <<'HTML';
<thead>
<tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
<tbody><tmpl_loop files>
<thead>
<tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
<tbody><tmpl_loop files>
-<tr><td class="title"><
tmpl_var title
><td class="artist"><tmpl_var artist><td class="album"><tmpl_var album><td class="genre"><tmpl_var genre><td class="track"><tmpl_var tracknumber>/<tmpl_var tracktotal><td class="year"><tmpl_var year><td class="formats"><tmpl_loop formats><a href="<tmpl_var ...prefix><tmpl_var ESCAPE=URL file>"><tmpl_var format></a> </tmpl_loop></tmpl_loop>
+<tr><td class="title"><
a href="#<tmpl_var fragment>" data-hash="#<tmpl_var fragment>"><tmpl_var title></a
><td class="artist"><tmpl_var artist><td class="album"><tmpl_var album><td class="genre"><tmpl_var genre><td class="track"><tmpl_var tracknumber>/<tmpl_var tracktotal><td class="year"><tmpl_var year><td class="formats"><tmpl_loop formats><a href="<tmpl_var ...prefix><tmpl_var ESCAPE=URL file>"><tmpl_var format></a> </tmpl_loop></tmpl_loop>
</table>
HTML
</table>
HTML
This page took
0.010707 seconds
and
4
git commands to generate.