1
0
Fork 0

Updated duration fix

This commit is contained in:
Gregory Eremin 2011-10-12 13:48:46 +04:00
parent 83047f5bf0
commit c22ccab188
1 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,9 @@ class window.Player
console.log(track)
if track.length == 0
len = parseInt(audio.duration, 10)
duration = Math.floor(len / 60)+':'+(len - Math.floor(len / 60) * 60)
m = Math.floor(len / 60)
s = len - Math.floor(len / 60) * 60
duration = m+':'+(s < 10 ? '0' : '')+s
_session.query '/track/update_length', { track_id: track.id, length: len }, (r) ->
if r.result is 'success'
$('.playlist li[data-id="'+track.id+'"] .song-duration').text(duration)