mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
auto-queue episodes
This commit is contained in:
parent
30015609f7
commit
cd2253bdea
2 changed files with 31 additions and 4 deletions
|
@ -469,7 +469,7 @@
|
||||||
return self.currentItem && self.currentItem.MediaType == mediaType;
|
return self.currentItem && self.currentItem.MediaType == mediaType;
|
||||||
};
|
};
|
||||||
|
|
||||||
function translateItemsForPlayback(items) {
|
function translateItemsForPlayback(items, smart) {
|
||||||
|
|
||||||
var firstItem = items[0];
|
var firstItem = items[0];
|
||||||
var promise;
|
var promise;
|
||||||
|
@ -511,6 +511,33 @@
|
||||||
MediaTypes: "Audio,Video"
|
MediaTypes: "Audio,Video"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else if (smart && firstItem.Type == "Episode" && items.length == 1) {
|
||||||
|
|
||||||
|
promise = ApiClient.getEpisodes(firstItem.SeriesId, {
|
||||||
|
IsVirtualUnaired: false,
|
||||||
|
IsMissing: false,
|
||||||
|
UserId: ApiClient.getCurrentUserId(),
|
||||||
|
Fields: getItemFields
|
||||||
|
|
||||||
|
}).then(function (episodesResult) {
|
||||||
|
|
||||||
|
var foundItem = false;
|
||||||
|
episodesResult.Items = episodesResult.Items.filter(function (e) {
|
||||||
|
|
||||||
|
if (foundItem) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (e.Id == firstItem.Id) {
|
||||||
|
foundItem = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
episodesResult.TotalRecordCount = episodesResult.Items.length;
|
||||||
|
return episodesResult;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (promise) {
|
if (promise) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
@ -537,7 +564,7 @@
|
||||||
|
|
||||||
if (options.items) {
|
if (options.items) {
|
||||||
|
|
||||||
translateItemsForPlayback(options.items).then(function (items) {
|
translateItemsForPlayback(options.items, true).then(function (items) {
|
||||||
|
|
||||||
self.playWithIntros(items, options, user);
|
self.playWithIntros(items, options, user);
|
||||||
});
|
});
|
||||||
|
@ -550,7 +577,7 @@
|
||||||
|
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
|
|
||||||
translateItemsForPlayback(result.Items).then(function (items) {
|
translateItemsForPlayback(result.Items, true).then(function (items) {
|
||||||
|
|
||||||
self.playWithIntros(items, options, user);
|
self.playWithIntros(items, options, user);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1826,7 +1826,7 @@ var AppInfo = {};
|
||||||
// Put the version into the bower path since we can't easily put a query string param on html imports
|
// Put the version into the bower path since we can't easily put a query string param on html imports
|
||||||
// Emby server will handle this
|
// Emby server will handle this
|
||||||
if (!Dashboard.isRunningInCordova()) {
|
if (!Dashboard.isRunningInCordova()) {
|
||||||
bowerPath += window.dashboardVersion;
|
//bowerPath += window.dashboardVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bowerPath;
|
return bowerPath;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue