Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi part audiobook #5603

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/components/playback/playbackmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,15 @@ class PlaybackManager {
}, queryOptions));
}

if (promise) {
return promise.then(function (result) {
if (firstItem.Type === 'AudioBook') {
options.startIndex = result.StartIndex;
}
return result ? result.Items : items;
});
}

return null;
}

Expand Down Expand Up @@ -2264,6 +2273,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');
Expand Down Expand Up @@ -3480,6 +3493,7 @@ class PlaybackManager {
};
}

// Add a player to the list of players and associate callbacks
function initMediaPlayer(player) {
players.push(player);
players.sort(function (a, b) {
Expand Down