1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #171 from cvium/fix_playback_order

Sort item results in the same order as requested
This commit is contained in:
Vasily 2019-03-11 15:38:21 +03:00 committed by GitHub
commit a0e9e59e0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1806,6 +1806,12 @@ define(['events', 'datetime', 'appSettings', 'itemHelper', 'pluginManager', 'pla
} }
function translateItemsForPlayback(items, options) { function translateItemsForPlayback(items, options) {
if (items.length > 1 && options && options.ids) {
// Use the original request id array for sorting the result in the proper order
items.sort(function (a, b) {
return options.ids.indexOf(a.Id) - options.ids.indexOf(b.Id);
});
}
var firstItem = items[0]; var firstItem = items[0];
var promise; var promise;