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:
commit
1918262a8f
2 changed files with 8 additions and 2 deletions
|
@ -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') {
|
||||||
|
|
||||||
|
|
|
@ -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) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue