mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Playback continuation and AudioBook playlist/queue now working as desired after minor modifications to playbackmanager.js
This commit is contained in:
parent
29b7071be7
commit
3226eef67e
3 changed files with 9 additions and 9 deletions
|
@ -1969,6 +1969,9 @@ class PlaybackManager {
|
|||
|
||||
if (promise) {
|
||||
return promise.then(function (result) {
|
||||
if (firstItem.Type === 'AudioBook') {
|
||||
options.startIndex = result.StartIndex;
|
||||
}
|
||||
return result ? result.Items : items;
|
||||
});
|
||||
} else {
|
||||
|
@ -1982,9 +1985,7 @@ class PlaybackManager {
|
|||
// This is the exposed function called to manage item media playback
|
||||
self.play = function (options) {
|
||||
normalizePlayOptions(options);
|
||||
console.debug('playing');
|
||||
|
||||
// I think this class *is* the "localpalyer", others are plugins or chromecast
|
||||
if (self._currentPlayer) {
|
||||
if (options.enableRemotePlayers === false && !self._currentPlayer.isLocalPlayer) {
|
||||
return Promise.reject();
|
||||
|
@ -1995,13 +1996,11 @@ class PlaybackManager {
|
|||
}
|
||||
}
|
||||
|
||||
console.debug('using "localplayer" (*wink*)');
|
||||
if (options.fullscreen) {
|
||||
loading.show();
|
||||
}
|
||||
|
||||
if (options.items) {
|
||||
console.debug('playing from options.items');
|
||||
return translateItemsForPlayback(options.items, options)
|
||||
.then((items) => getAdditionalParts(items))
|
||||
.then(function (allItems) {
|
||||
|
@ -2009,7 +2008,6 @@ class PlaybackManager {
|
|||
return playWithIntros(flattened, options);
|
||||
});
|
||||
} else {
|
||||
console.debug('calling getItemsForPlayback');
|
||||
if (!options.serverId) {
|
||||
throw new Error('serverId required!');
|
||||
}
|
||||
|
@ -2238,6 +2236,10 @@ class PlaybackManager {
|
|||
}
|
||||
|
||||
function playInternal(item, playOptions, onPlaybackStartedFn, prevSource) {
|
||||
if (item.Type === 'AudioBookFile') {
|
||||
playOptions.startPositionTicks = item.UserData.PlaybackPositionTicks;
|
||||
}
|
||||
|
||||
if (item.IsPlaceHolder) {
|
||||
loading.hide();
|
||||
showPlaybackInfoErrorMessage(self, 'PlaybackErrorPlaceHolder');
|
||||
|
@ -2499,6 +2501,7 @@ class PlaybackManager {
|
|||
}
|
||||
|
||||
return Promise.all([promise, player.getDeviceProfile(item)]).then(function (responses) {
|
||||
// TODO: Why does this skip the first entry?
|
||||
const deviceProfile = responses[1];
|
||||
|
||||
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
||||
|
|
|
@ -693,9 +693,7 @@ class AppRouter {
|
|||
return url;
|
||||
}
|
||||
if (item.CollectionType == CollectionType.Books) {
|
||||
let urlForList = '#/books.html?topParentId=' + item.Id;
|
||||
|
||||
return urlForList;
|
||||
return '#/books.html?parentId=' + id + '&serverId=' + serverId + '&topParentId=' + item.Id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,6 @@ function getItems(instance, params, item, sortBy, startIndex, limit) {
|
|||
instance.queryRecursive = false;
|
||||
|
||||
if (!item) {
|
||||
// console.log("I dont think this is right");
|
||||
instance.queryRecursive = true;
|
||||
|
||||
return apiClient['getItems'](apiClient.getCurrentUserId(), modifyQueryWithFilters(instance, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue