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

Merge pull request #1368 from itegulov/books-resume

Make book player restore location on resume
This commit is contained in:
dkanada 2020-06-08 03:59:53 +09:00 committed by GitHub
commit 1918262a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -273,7 +273,7 @@ define(['datetime', 'globalize', 'appRouter', 'itemHelper', 'indicators', 'mater
} }
} }
if (item.RunTimeTicks && item.Type !== 'Series' && item.Type !== 'Program' && !showFolderRuntime && options.runtime !== false) { if (item.RunTimeTicks && item.Type !== 'Series' && item.Type !== 'Program' && item.Type !== 'Book' && !showFolderRuntime && options.runtime !== false) {
if (item.Type === 'Audio') { if (item.Type === 'Audio') {

View file

@ -238,11 +238,17 @@ export class BookPlayer {
this.bindEvents(); this.bindEvents();
return this._rendition.book.locations.generate(1024).then(() => { return this._rendition.book.locations.generate(1024).then(async () => {
if (cancellationToken.shouldCancel) { if (cancellationToken.shouldCancel) {
return reject(); return reject();
} }
const percentageTicks = options.startPositionTicks / 10000000;
if (percentageTicks !== 0.0) {
const resumeLocation = book.locations.cfiFromPercentage(percentageTicks);
await rendition.display(resumeLocation);
}
this._loaded = true; this._loaded = true;
epubElem.style.display = 'block'; epubElem.style.display = 'block';
rendition.on('relocated', (locations) => { rendition.on('relocated', (locations) => {