diff --git a/components/cards/LazyBookCard.vue b/components/cards/LazyBookCard.vue index 65b763d0..71d98f54 100644 --- a/components/cards/LazyBookCard.vue +++ b/components/cards/LazyBookCard.vue @@ -274,8 +274,13 @@ export default { if (this.isLocal) return this.store.getters['globals/getLocalMediaProgressById'](this.libraryItemId) return this.store.getters['user/getUserMediaProgress'](this.libraryItemId) }, + useEBookProgress() { + if (!this.userProgress || this.userProgress.progress) return false + return this.userProgress.ebookProgress > 0 + }, userProgressPercent() { - return this.userProgress ? this.userProgress.progress || 0 : 0 + if (this.useEBookProgress) return Math.max(Math.min(1, this.userProgress.ebookProgress), 0) + return this.userProgress ? Math.max(Math.min(1, this.userProgress.progress), 0) || 0 : 0 }, itemIsFinished() { return this.userProgress ? !!this.userProgress.isFinished : false diff --git a/components/readers/EpubReader.vue b/components/readers/EpubReader.vue index 09a11c01..9641d192 100644 --- a/components/readers/EpubReader.vue +++ b/components/readers/EpubReader.vue @@ -1,6 +1,7 @@ diff --git a/pages/bookshelf/index.vue b/pages/bookshelf/index.vue index 01655d0b..262568a5 100644 --- a/pages/bookshelf/index.vue +++ b/pages/bookshelf/index.vue @@ -297,7 +297,7 @@ export default { } const continueListeningShelf = this.shelves.find((cat) => cat.id === 'continue-listening') - const mostRecentEntity = continueListeningShelf?.entities?.[0] + const mostRecentEntity = continueListeningShelf?.entities?.find((li) => li.media?.audioTracks?.length || li.media?.numTracks) if (mostRecentEntity) { const playObject = { libraryItemId: mostRecentEntity.id, diff --git a/pages/item/_id/index.vue b/pages/item/_id/index.vue index 7ac8e889..9cab5bd7 100644 --- a/pages/item/_id/index.vue +++ b/pages/item/_id/index.vue @@ -65,8 +65,8 @@

Your Progress: {{ Math.round(progressPercent * 100) }}%

-

{{ $elapsedPretty(userTimeRemaining) }} remaining

-

Finished {{ $formatDate(userProgressFinishedAt) }}

+

{{ $elapsedPretty(userTimeRemaining) }} remaining

+

Finished {{ $formatDate(userProgressFinishedAt) }}

@@ -311,7 +311,12 @@ export default { const duration = this.userItemProgress.duration || this.duration return duration - this.userItemProgress.currentTime }, + useEBookProgress() { + if (!this.userItemProgress || this.userItemProgress.progress) return false + return this.userItemProgress.ebookProgress > 0 + }, progressPercent() { + if (this.useEBookProgress) return Math.max(Math.min(1, this.userItemProgress.ebookProgress), 0) return this.userItemProgress ? Math.max(Math.min(1, this.userItemProgress.progress), 0) : 0 }, userProgressFinishedAt() {