diff --git a/components/bookshelf/LazyBookshelf.vue b/components/bookshelf/LazyBookshelf.vue index 6ecc2f26..5c2cd16a 100644 --- a/components/bookshelf/LazyBookshelf.vue +++ b/components/bookshelf/LazyBookshelf.vue @@ -72,6 +72,9 @@ export default { showBookshelfListView() { return this.isBookEntity && this.bookshelfListView }, + sortingIgnorePrefix() { + return this.$store.getters['getServerSetting']('sortingIgnorePrefix') + }, entityName() { return this.page }, diff --git a/components/cards/LazyBookCard.vue b/components/cards/LazyBookCard.vue index 11421f69..334b0241 100644 --- a/components/cards/LazyBookCard.vue +++ b/components/cards/LazyBookCard.vue @@ -139,9 +139,6 @@ export default { } }, computed: { - showExperimentalFeatures() { - return this.store.state.showExperimentalFeatures - }, _libraryItem() { return this.libraryItem || {} }, diff --git a/components/cards/LazyListBookCard.vue b/components/cards/LazyListBookCard.vue index 333507d9..4a7c3649 100644 --- a/components/cards/LazyListBookCard.vue +++ b/components/cards/LazyListBookCard.vue @@ -18,7 +18,7 @@

#{{ seriesSequence }} {{ displayTitle }}

-

by {{ displayAuthor }}

+

{{ displayAuthor }}

{{ displaySortLine }}

{{ $elapsedPretty(duration) }}

{{ episodes }}

@@ -81,9 +81,6 @@ export default { } }, computed: { - showExperimentalFeatures() { - return this.store.state.showExperimentalFeatures - }, _libraryItem() { return this.libraryItem || {} }, @@ -187,20 +184,21 @@ export default { }, booksInSeries() { // Only added to item object when collapseSeries is enabled - return this.collapsedSeries ? this.collapsedSeries.numBooks : 0 + return this.collapsedSeries?.numBooks || 0 }, displayTitle() { - if (this.orderBy === 'media.metadata.title' && this.sortingIgnorePrefix && this.title.toLowerCase().startsWith('the ')) { - return this.title.substr(4) + ', The' - } - return this.title + const ignorePrefix = this.orderBy === 'media.metadata.title' && this.sortingIgnorePrefix + if (this.collapsedSeries) return ignorePrefix ? this.collapsedSeries.nameIgnorePrefix : this.collapsedSeries.name + return ignorePrefix ? this.mediaMetadata.titleIgnorePrefix : this.title }, displayAuthor() { if (this.isPodcast) return this.author + if (this.collapsedSeries) return `${this.booksInSeries} books in series` if (this.orderBy === 'media.metadata.authorNameLF') return this.authorLF return this.author }, displaySortLine() { + if (this.collapsedSeries) return null if (this.orderBy === 'mtimeMs') return 'Modified ' + this.$formatDate(this._libraryItem.mtimeMs) if (this.orderBy === 'birthtimeMs') return 'Born ' + this.$formatDate(this._libraryItem.birthtimeMs) if (this.orderBy === 'addedAt') return 'Added ' + this.$formatDate(this._libraryItem.addedAt) @@ -217,19 +215,19 @@ export default { return this.userProgress ? !!this.userProgress.isFinished : false }, showError() { - return this.hasMissingParts || this.hasInvalidParts || this.isMissing || this.isInvalid + return this.numMissingParts || this.isMissing || this.isInvalid }, isStreaming() { return this.store.getters['getlibraryItemIdStreaming'] === this.libraryItemId }, showReadButton() { - return !this.isSelectionMode && this.showExperimentalFeatures && !this.showPlayButton && this.hasEbook + return !this.isSelectionMode && !this.showPlayButton && this.hasEbook }, showPlayButton() { return !this.isSelectionMode && !this.isMissing && !this.isInvalid && this.numTracks && !this.isStreaming }, showSmallEBookIcon() { - return !this.isSelectionMode && this.showExperimentalFeatures && this.hasEbook + return !this.isSelectionMode && this.hasEbook }, isMissing() { return this._libraryItem.isMissing @@ -237,85 +235,13 @@ export default { isInvalid() { return this._libraryItem.isInvalid }, - hasMissingParts() { - return this._libraryItem.hasMissingParts - }, - hasInvalidParts() { - return this._libraryItem.hasInvalidParts - }, - errorText() { - if (this.isMissing) return 'Item directory is missing!' - else if (this.isInvalid) return 'Item has no media files' - var txt = '' - if (this.hasMissingParts) { - txt = `${this.hasMissingParts} missing parts.` - } - if (this.hasInvalidParts) { - if (this.hasMissingParts) txt += ' ' - txt += `${this.hasInvalidParts} invalid parts.` - } - return txt || 'Unknown Error' - }, - overlayWrapperClasslist() { - var classes = [] - if (this.isSelectionMode) classes.push('bg-opacity-60') - else classes.push('bg-opacity-40') - if (this.selected) { - classes.push('border-2 border-yellow-400') - } - return classes + numMissingParts() { + if (this.isPodcast) return 0 + return this.media.numMissingParts }, store() { return this.$store || this.$nuxt.$store }, - userCanUpdate() { - return this.store.getters['user/getUserCanUpdate'] - }, - userCanDelete() { - return this.store.getters['user/getUserCanDelete'] - }, - userCanDownload() { - return this.store.getters['user/getUserCanDownload'] - }, - userIsRoot() { - return this.store.getters['user/getIsRoot'] - }, - titleFontSize() { - return 0.75 * this.sizeMultiplier - }, - authorFontSize() { - return 0.6 * this.sizeMultiplier - }, - placeholderCoverPadding() { - return 0.8 * this.sizeMultiplier - }, - authorBottom() { - return 0.75 * this.sizeMultiplier - }, - titleCleaned() { - if (!this.title) return '' - if (this.title.length > 60) { - return this.title.slice(0, 57) + '...' - } - return this.title - }, - authorCleaned() { - if (!this.author) return '' - if (this.author.length > 30) { - return this.author.slice(0, 27) + '...' - } - return this.author - }, - isAlternativeBookshelfView() { - return false - // var constants = this.$constants || this.$nuxt.$constants - // return this.bookshelfView === constants.BookshelfView.TITLES - }, - titleDisplayBottomOffset() { - if (!this.isAlternativeBookshelfView) return 0 - else if (!this.displaySortLine) return 3 * this.sizeMultiplier - return 4.25 * this.sizeMultiplier - }, coverWidth() { return 80 / this.bookCoverAspectRatio } @@ -340,7 +266,7 @@ export default { } else { var router = this.$router || this.$nuxt.$router if (router) { - if (this.collapsedSeries) router.push(`/library/${this.libraryId}/series/${this.collapsedSeries.id}`) + if (this.collapsedSeries) router.push(`/bookshelf/series/${this.collapsedSeries.id}`) else router.push(`/item/${this.libraryItemId}`) } } diff --git a/components/covers/GroupCover.vue b/components/covers/GroupCover.vue index d173b7fc..3e25c6d7 100644 --- a/components/covers/GroupCover.vue +++ b/components/covers/GroupCover.vue @@ -51,9 +51,6 @@ export default { if (this.bookCoverAspectRatio === 1) return this.width / (120 * 1.6 * 2) return this.width / 240 }, - showExperimentalFeatures() { - return this.store.state.showExperimentalFeatures - }, store() { return this.$store || this.$nuxt.$store }, diff --git a/components/readers/Reader.vue b/components/readers/Reader.vue index dd1db827..297bc0fd 100644 --- a/components/readers/Reader.vue +++ b/components/readers/Reader.vue @@ -217,7 +217,6 @@ export default { return Capacitor.convertFileSrc(this.localContentUrl) } const serverAddress = this.$store.getters['user/getServerAddress'] - if (this.ebookFileId) { return `${serverAddress}/api/items/${this.selectedLibraryItem.id}/ebook/${this.ebookFileId}` }