diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue index eb4e9424a..0c4562a4d 100644 --- a/client/components/app/BookShelfCategorized.vue +++ b/client/components/app/BookShelfCategorized.vue @@ -4,10 +4,10 @@
-

{{ libraryName }} Library is empty!

+

{{ $getString('MessageXLibraryIsEmpty', [libraryName]) }}

- Configure Scanner - Scan Library + {{ $strings.ButtonConfigureScanner }} + {{ $strings.ButtonScanLibrary }}
@@ -58,7 +58,8 @@ export default { scannerParseSubtitle: false, wrapperClientWidth: 0, shelves: [], - lastItemIndexSelected: -1 + lastItemIndexSelected: -1, + tempIsScanning: false } }, computed: { @@ -97,6 +98,9 @@ export default { }, streamLibraryItem() { return this.$store.state.streamLibraryItem + }, + isScanningLibrary() { + return !!this.$store.getters['tasks/getRunningLibraryScanTask'](this.currentLibraryId) } }, methods: { @@ -273,14 +277,15 @@ export default { this.shelves = shelves }, scan() { + this.tempIsScanning = true this.$store .dispatch('libraries/requestLibraryScan', { libraryId: this.$store.state.libraries.currentLibraryId }) - .then(() => { - this.$toast.success('Library scan started') - }) .catch((error) => { console.error('Failed to start scan', error) - this.$toast.error('Failed to start scan') + this.$toast.error(this.$strings.ToastLibraryScanFailedToStart) + }) + .finally(() => { + this.tempIsScanning = false }) }, userUpdated(user) { diff --git a/client/components/app/LazyBookshelf.vue b/client/components/app/LazyBookshelf.vue index 5291cdbba..805c69783 100644 --- a/client/components/app/LazyBookshelf.vue +++ b/client/components/app/LazyBookshelf.vue @@ -10,7 +10,7 @@

{{ $getString('MessageXLibraryIsEmpty', [libraryName]) }}

{{ $strings.ButtonConfigureScanner }} - {{ $strings.ButtonScanLibrary }} + {{ $strings.ButtonScanLibrary }}
@@ -62,7 +62,8 @@ export default { currScrollTop: 0, resizeTimeout: null, mountWindowWidth: 0, - lastItemIndexSelected: -1 + lastItemIndexSelected: -1, + tempIsScanning: false } }, watch: { @@ -208,6 +209,9 @@ export default { }, streamLibraryItem() { return this.$store.state.streamLibraryItem + }, + isScanningLibrary() { + return !!this.$store.getters['tasks/getRunningLibraryScanTask'](this.currentLibraryId) } }, methods: { @@ -727,14 +731,15 @@ export default { } }, scan() { + this.tempIsScanning = true this.$store .dispatch('libraries/requestLibraryScan', { libraryId: this.currentLibraryId }) - .then(() => { - this.$toast.success('Library scan started') - }) .catch((error) => { console.error('Failed to start scan', error) - this.$toast.error('Failed to start scan') + this.$toast.error(this.$strings.ToastLibraryScanFailedToStart) + }) + .finally(() => { + this.tempIsScanning = false }) } }, @@ -775,4 +780,4 @@ export default { background: var(--bookshelf-divider-bg); box-shadow: 2px 14px 8px #111111aa; } - \ No newline at end of file + diff --git a/client/components/app/MediaPlayerContainer.vue b/client/components/app/MediaPlayerContainer.vue index 3c4b1d35b..e00d4554a 100644 --- a/client/components/app/MediaPlayerContainer.vue +++ b/client/components/app/MediaPlayerContainer.vue @@ -6,9 +6,12 @@
- - {{ title }} - +
+ + {{ title }} + + +
person
@@ -18,7 +21,6 @@ {{ author.name }}
{{ $strings.LabelUnknown }}
-
@@ -136,7 +138,7 @@ export default { return this.streamLibraryItem?.mediaType === 'music' }, isExplicit() { - return this.mediaMetadata.explicit || false + return !!this.mediaMetadata.explicit }, mediaMetadata() { return this.media.metadata || {} diff --git a/client/components/cards/BookMatchCard.vue b/client/components/cards/BookMatchCard.vue index f2c15280e..d5355e915 100644 --- a/client/components/cards/BookMatchCard.vue +++ b/client/components/cards/BookMatchCard.vue @@ -13,9 +13,9 @@

{{ book.publishedYear }}

-

by {{ book.author }}

-

Narrated by {{ book.narrator }}

-

Runtime: {{ $elapsedPrettyExtended(bookDuration, false) }} {{ bookDurationComparison }}

+

{{ $getString('LabelByAuthor', [book.author]) }}

+

{{ $strings.LabelNarrators }}: {{ book.narrator }}

+

{{ $strings.LabelDuration }}: {{ $elapsedPrettyExtended(bookDuration, false) }} {{ bookDurationComparison }}

@@ -29,9 +29,9 @@

-
{{ book.title }}
+
{{ book.title }}

-

by {{ book.author }}

+

{{ $getString('LabelByAuthor', [book.author]) }}

{{ book.genres.join(', ') }}

{{ book.trackCount }} Episodes

@@ -75,11 +75,11 @@ export default { let differenceInMinutes = currentBookDurationMinutes - this.book.duration if (differenceInMinutes < 0) { differenceInMinutes = Math.abs(differenceInMinutes) - return `(${this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)} shorter)` + return this.$getString('LabelDurationComparisonLonger', [this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)]) } else if (differenceInMinutes > 0) { - return `(${this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)} longer)` + return this.$getString('LabelDurationComparisonShorter', [this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)]) } - return '(exact match)' + return this.$strings.LabelDurationComparisonExactMatch } }, methods: { diff --git a/client/components/cards/ItemSearchCard.vue b/client/components/cards/ItemSearchCard.vue index f1b5bf3d4..bfcac8f0d 100644 --- a/client/components/cards/ItemSearchCard.vue +++ b/client/components/cards/ItemSearchCard.vue @@ -7,7 +7,7 @@

-

by {{ authorName }}

+

{{ $getString('LabelByAuthor', [authorName]) }}

@@ -69,7 +69,7 @@ export default { if (this.matchKey === 'episode') return `

${this.$strings.LabelEpisode}: ${html}

` if (this.matchKey === 'tags') return `

${this.$strings.LabelTags}: ${html}

` if (this.matchKey === 'subtitle') return `

${html}

` - if (this.matchKey === 'authors') return `by ${html}` + if (this.matchKey === 'authors') this.$getString('LabelByAuthor', [html]) if (this.matchKey === 'isbn') return `

ISBN: ${html}

` if (this.matchKey === 'asin') return `

ASIN: ${html}

` if (this.matchKey === 'series') return `

${this.$strings.LabelSeries}: ${html}

` @@ -90,4 +90,4 @@ export default { flex-direction: column; justify-content: center; } - \ No newline at end of file + diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index faa93997f..0bfac85fc 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -1,128 +1,124 @@