From 4dc020e4a7747ddba3165ae2297033176612caa3 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 8 Aug 2011 16:38:02 -0700 Subject: [PATCH] show a few more file details --- beetsplug/web/static/beets.js | 26 ++++++++++++++------------ beetsplug/web/templates/index.html | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/beetsplug/web/static/beets.js b/beetsplug/web/static/beets.js index c2dedbf97..6305a6ecf 100644 --- a/beetsplug/web/static/beets.js +++ b/beetsplug/web/static/beets.js @@ -1,3 +1,17 @@ +// Format times as minutes and seconds. +var timeFormat = function(secs) { + if (secs == undefined || isNaN(secs)) { + return '0:00'; + } + secs = Math.round(secs); + var mins = '' + Math.round(secs / 60); + secs = '' + (secs % 60); + if (secs.length < 2) { + secs = '0' + secs; + } + return mins + ':' + secs; +} + // jQuery extension encapsulating event hookups for audio element controls. $.fn.player = function(debug) { // Selected element should contain an HTML5 Audio element. @@ -22,18 +36,6 @@ $.fn.player = function(debug) { }); // Utilities. - var timeFormat = function(secs) { - if (secs == undefined || isNaN(secs)) { - return '0:00'; - } - secs = Math.round(secs); - var mins = '' + Math.round(secs / 60); - secs = '' + (secs % 60); - if (secs.length < 2) { - secs = '0' + secs; - } - return mins + ':' + secs; - } var timePercent = function(cur, total) { if (cur == undefined || isNaN(cur) || total == undefined || isNaN(total) || total == 0) { diff --git a/beetsplug/web/templates/index.html b/beetsplug/web/templates/index.html index 9ac08d026..27f9ce30a 100644 --- a/beetsplug/web/templates/index.html +++ b/beetsplug/web/templates/index.html @@ -53,8 +53,7 @@ <%= title %> - download - +
Track
@@ -63,12 +62,22 @@
Disc
<%= disc %>/<%= disctotal %>
<% } %> +
Length
+
<%= timeFormat(length) %>
+
Format
+
<%= format %>
+
Bitrate
+
<%= Math.round(bitrate/1000) %> kbps
<% if (mb_trackid) { %>
MuscBrainz entry
- view + view
<% } %> +
File
+
+ download +
<% if (lyrics) { %>
Lyrics
<%= lyrics %>