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
2 changed files with 8 additions and 2 deletions
+1 -1
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') {
+7 -1
View File
@@ -238,11 +238,17 @@ export class BookPlayer {
this.bindEvents();
return this._rendition.book.locations.generate(1024).then(() => {
return this._rendition.book.locations.generate(1024).then(async () => {
if (cancellationToken.shouldCancel) {
return reject();
}
const percentageTicks = options.startPositionTicks / 10000000;
if (percentageTicks !== 0.0) {
const resumeLocation = book.locations.cfiFromPercentage(percentageTicks);
await rendition.display(resumeLocation);
}
this._loaded = true;
epubElem.style.display = 'block';
rendition.on('relocated', (locations) => {