diff options
author | neoflex <neoflexx@gmail.com> | 2011-07-01 00:49:02 -0700 |
---|---|---|
committer | Valentin Grouès <neoflexx@gmail.com> | 2011-07-04 10:50:31 +0200 |
commit | e76e9b2ce2f9a1e9fd1a274295415e7493ccf215 (patch) | |
tree | c8d4ca767f0c8ceda3d46f7fbd5c54461f72d62e /addons/webinterface.default | |
parent | 7915c249eeea01036f936f62011c4888e99f86f5 (diff) |
playing tracks wasn't working. Fixed the playtrack function to use AudioPlaylist.Play with the correct parameters (track position in playlist). The sorting option of AudioLibrary.GetSongs doesn't seem to work at this moment.
Diffstat (limited to 'addons/webinterface.default')
-rwxr-xr-x[-rw-r--r--] | addons/webinterface.default/js/MediaLibrary.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/addons/webinterface.default/js/MediaLibrary.js b/addons/webinterface.default/js/MediaLibrary.js index 348ea5f427..5768d3220a 100644..100755 --- a/addons/webinterface.default/js/MediaLibrary.js +++ b/addons/webinterface.default/js/MediaLibrary.js @@ -193,27 +193,27 @@ MediaLibrary.prototype = { } $('#albumDetails' + event.data.album.albumid + ' .resultSet').append(trackRow); } - var trackRow = $('<tr>').addClass('trackRow').addClass('tr' + i % 2); + var trackRow = $('<tr>').addClass('trackRow').addClass('tr' + i % 2).bind('click', { album: event.data.album, itmnbr: i }, jQuery.proxy(this.playTrack,this)); var trackNumberTD = $('<td>') .html(item.track) - //.bind('click', { song: item, album: event.data.album }, jQuery.proxy(this.playTrack, this)); + trackRow.append(trackNumberTD); var trackTitleTD = $('<td>') .html(item.title); - //.bind('click', { song: item, album: event.data.album }, jQuery.proxy(this.playTrack, this)); + trackRow.append(trackTitleTD); var trackDurationTD = $('<td>') .addClass('time') .html(durationToString(item.duration)); - //.bind('click', { song: item, album: event.data.album }, jQuery.proxy(this.playTrack, this)); + trackRow.append(trackDurationTD); var trackArtistTD = $('<td>') .html(item.artist); - //.bind('click', { song: item, album: event.data.album }, jQuery.proxy(this.playTrack, this)); + trackRow.append(trackArtistTD); var trackGenreTD = $('<td>') .html(item.genre); - //.bind('click', { song: item, album: event.data.album }, jQuery.proxy(this.playTrack, this)); + trackRow.append(trackGenreTD); $('#albumDetails' + event.data.album.albumid + ' .resultSet').append(trackRow); }, this)); @@ -378,7 +378,7 @@ MediaLibrary.prototype = { //check that clear worked. jQuery.post(JSON_RPC + '?AddAlbumToPlaylist', '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "item": { "albumid": ' + event.data.album.albumid + ' } }, "id": 1}', jQuery.proxy(function(data) { //play specific song in playlist - jQuery.post(JSON_RPC + '?PlaylistItemPlay', '{"jsonrpc": "2.0", "method": "AudioPlaylist.Play", "params": { "item": { "file": ' + event.data.song.file + ' } }, "id": 1}', function() {}, 'json'); + jQuery.post(JSON_RPC + '?PlaylistItemPlay', '{"jsonrpc": "2.0", "method": "AudioPlaylist.Play", "params": { "item": '+ event.data.itmnbr + ' }, "id": 1}', function() {}, 'json'); }, this), 'json'); }, this), 'json'); }, |