Single track add fix
This commit is contained in:
parent
9f085242e2
commit
1acd9ba6d6
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue