1
0
Fork 0

Single track add fix

This commit is contained in:
magnolia-fan 2011-10-06 00:00:27 +04:00
parent 9f085242e2
commit 1acd9ba6d6
2 changed files with 9 additions and 5 deletions

View File

@ -233,7 +233,11 @@ $('.add-album').live 'click', ->
$('.s-add').live 'click', ->
artist = $('.artist-info h2').text()
album = _player.albums[$(this).attr('data-album-id')]
item = album.tracks[$(this).attr('data-id')-1]
item['artist'] = artist
item['album'] = album.name
_player.addTracks [item]
item = album.tracks[$(this).attr('data-id')]
for item in album.tracks
if item.id == parseInt($(this).attr('data-id'), 10)
item['artist'] = artist
item['album'] = album.name
_player.addTracks [item]
return false
false

View File

@ -28,5 +28,5 @@
%tr
%td.song-title= track[:name]
%td.song-duration
.s-duration= (track[:duration] unless track[:duration] == '0:00')
.s-duration= (track[:duration] != '0:00' ? track[:duration] : ' '.html_safe)
.s-add{ :'data-album-id' => album[:id], :'data-id' => track[:id] }= I18n.t 'player.add_one'