Adds playlist management and playback

This commit is contained in:
BinaryAlley committed 2026-10-21 16:30:58 +03:00
1 parent 009a0c8156
commit 9889c86c76
296 files changed
+18830 -367

No files matched your search

@@ -62,7 +62,8 @@
const jsLocalizedStrings = {
actions: @Json.Serialize(_localizer["Actions"].Value),
play: @Json.Serialize(_localizer["Play"].Value),
shuffle: @Json.Serialize(_localizer["Shuffle"].Value)
shuffle: @Json.Serialize(_localizer["Shuffle"].Value),
addToPlaylist: @Json.Serialize(_localizer["AddToPlaylist"].Value)
};
// Closes the actions menus of all the music library cards.
@@ -157,6 +158,20 @@
shuffleAction.dataset.libraryId = library.id;
menu.appendChild(shuffleAction);
const addToPlaylistAction = document.createElement('a');
addToPlaylistAction.setAttribute('role', 'menuitem');
addToPlaylistAction.href = '#';
addToPlaylistAction.className = 'card-action-add-to-playlist';
addToPlaylistAction.textContent = jsLocalizedStrings.addToPlaylist;
addToPlaylistAction.addEventListener('click', async event => {
event.preventDefault();
event.stopImmediatePropagation();
closeCardMenus();
if (window.LuminaPlaylists)
await window.LuminaPlaylists.showAddScopeDialogAsync({ libraryId: library.id, title: library.title || '', addToPlaylistLabel: jsLocalizedStrings.addToPlaylist, returnFocus: trigger });
});
menu.appendChild(addToPlaylistAction);
menu.addEventListener('click', event => {
// The global audio player delegation handles the play and shuffle actions; the menu only closes here.
if (event.target.closest('.card-action-play, .card-action-shuffle'))