mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
fixes #505 - Add play shuffle to web client
This commit is contained in:
parent
44c1876907
commit
ae1fb68053
@ -340,12 +340,15 @@
|
||||
}
|
||||
else if (itemType == "MusicAlbum") {
|
||||
html += '<li><a href="#" onclick="MediaPlayer.playInstantMixFromAlbum(\'' + itemId + '\');LibraryBrowser.closePlayMenu();">Instant Mix</a></li>';
|
||||
html += '<li><a href="#" onclick="MediaPlayer.shuffleFolder(\'' + itemId + '\');LibraryBrowser.closePlayMenu();">Shuffle</a></li>';
|
||||
}
|
||||
else if (itemType == "Artist") {
|
||||
html += '<li><a href="#" onclick="MediaPlayer.playInstantMixFromArtist(\'' + itemId + '\');LibraryBrowser.closePlayMenu();">Instant Mix</a></li>';
|
||||
html += '<li><a href="#" onclick="MediaPlayer.shuffleArtist(\'' + itemId + '\');LibraryBrowser.closePlayMenu();">Shuffle</a></li>';
|
||||
}
|
||||
else if (itemType == "MusicGenre") {
|
||||
html += '<li><a href="#" onclick="MediaPlayer.playInstantMixFromMusicGenre(\'' + itemId + '\');LibraryBrowser.closePlayMenu();">Instant Mix</a></li>';
|
||||
html += '<li><a href="#" onclick="MediaPlayer.shuffleMusicGenre(\'' + itemId + '\');LibraryBrowser.closePlayMenu();">Shuffle</a></li>';
|
||||
}
|
||||
|
||||
if (resumePositionTicks) {
|
||||
|
@ -1044,6 +1044,56 @@
|
||||
|
||||
};
|
||||
|
||||
self.shuffleArtist = function (artist) {
|
||||
|
||||
self.getItemsForPlayback({
|
||||
|
||||
Artists: artist,
|
||||
Recursive: true,
|
||||
SortBy: "Random",
|
||||
IncludeItemTypes: "Audio"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
self.play(result.Items);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
self.shuffleMusicGenre = function (genre) {
|
||||
|
||||
self.getItemsForPlayback({
|
||||
|
||||
Genres: genre,
|
||||
Recursive: true,
|
||||
SortBy: "Random",
|
||||
IncludeItemTypes: "Audio"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
self.play(result.Items);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
self.shuffleFolder = function (id) {
|
||||
|
||||
self.getItemsForPlayback({
|
||||
|
||||
ParentId: id,
|
||||
Recursive: true,
|
||||
SortBy: "Random"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
self.play(result.Items);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
self.toggleFullscreen = function () {
|
||||
if (isFullScreen()) {
|
||||
if (document.cancelFullScreen) { document.cancelFullScreen(); }
|
||||
|
Loading…
Reference in New Issue
Block a user