03-02-2025, 09:24 PM
Yes thats the file for REST API commands.
As far as "album" goes you need to think about the group of tracks that makes up the album. For example in Tag or Album view, playing an album actually submits an array containing the album tracks to the Queue.
Have a look in scripts-library.js "play_group" and "Play_group_next"
Folders on the other hand can be added to the Queue via the MPD "add" command and all the files in the folder will be automatically added. Playlists can be added to the Queue via the MPD "load" command.
As far as "album" goes you need to think about the group of tracks that makes up the album. For example in Tag or Album view, playing an album actually submits an array containing the album tracks to the Queue.
Have a look in scripts-library.js "play_group" and "Play_group_next"
Code:
// Click coverart context menu item
$('#context-menu-lib-album a').click(function(e) {
UI.dbEntry[0] = $.isNumeric(UI.dbEntry[0]) ? UI.dbEntry[0] : 0;
if (!$('.album-view-button').hasClass('active')) {
$('#lib-song-' + (UI.dbEntry[0] + 1).toString()).removeClass('active');
$('img.lib-coverart, #lib-coverart-meta-area').removeClass('active');
}
// Order the files according the the order of the albums
var files = [];
for (i = 0; i < filteredAlbums.length; i++) {
for (j = 0; j < filteredSongs.length; j++) {
if (filteredSongs[j].key == filteredAlbums[i].key) {
files.push(filteredSongs[j].file);
}
}
}
//console.log('files= ' + JSON.stringify(files));
switch ($(this).data('cmd')) {
case 'add_group':
case 'add_group_next':
sendQueueCmd($(this).data('cmd'), files);
notify(NOTIFY_TITLE_INFO, $(this).data('cmd'), NOTIFY_DURATION_SHORT);
break;
case 'play_group':
case 'play_group_next':
sendQueueCmd($(this).data('cmd'), files);
break;
Folders on the other hand can be added to the Queue via the MPD "add" command and all the files in the folder will be automatically added. Playlists can be added to the Queue via the MPD "load" command.