diff --git a/client/components/modals/authors/EditModal.vue b/client/components/modals/authors/EditModal.vue index 09ca7806e..a31cfd872 100644 --- a/client/components/modals/authors/EditModal.vue +++ b/client/components/modals/authors/EditModal.vue @@ -9,7 +9,7 @@
- +
delete
@@ -30,9 +30,6 @@
-
@@ -106,9 +103,9 @@ export default { methods: { init() { this.imageUrl = '' - this.authorCopy.name = this.author.name - this.authorCopy.asin = this.author.asin - this.authorCopy.description = this.author.description + this.authorCopy = { + ...this.author + } }, removeClick() { const payload = { @@ -171,7 +168,9 @@ export default { .$delete(`/api/authors/${this.authorId}/image`) .then((data) => { this.$toast.success(this.$strings.ToastAuthorImageRemoveSuccess) - this.$store.commit('globals/showEditAuthorModal', data.author) + + this.authorCopy.updatedAt = data.author.updatedAt + this.authorCopy.imagePath = data.author.imagePath }) .catch((error) => { console.error('Failed', error) @@ -196,7 +195,9 @@ export default { .then((data) => { this.imageUrl = '' this.$toast.success('Author image updated') - this.$store.commit('globals/showEditAuthorModal', data.author) + + this.authorCopy.updatedAt = data.author.updatedAt + this.authorCopy.imagePath = data.author.imagePath }) .catch((error) => { console.error('Failed', error) @@ -231,8 +232,11 @@ export default { } else if (response.updated) { if (response.author.imagePath) { this.$toast.success(this.$strings.ToastAuthorUpdateSuccess) - this.$store.commit('globals/showEditAuthorModal', response.author) } else this.$toast.success(this.$strings.ToastAuthorUpdateSuccessNoImageFound) + + this.authorCopy = { + ...response.author + } } else { this.$toast.info('No updates were made for Author') } diff --git a/client/components/modals/emails/EReaderDeviceModal.vue b/client/components/modals/emails/EReaderDeviceModal.vue index 79d80f7c4..70b295ae6 100644 --- a/client/components/modals/emails/EReaderDeviceModal.vue +++ b/client/components/modals/emails/EReaderDeviceModal.vue @@ -46,7 +46,12 @@ export default { ereaderDevice: { type: Object, default: () => null - } + }, + users: { + type: Array, + default: () => [] + }, + loadUsers: Function }, data() { return { @@ -56,8 +61,7 @@ export default { email: '', availabilityOption: 'adminAndUp', users: [] - }, - users: [] + } } }, watch: { @@ -108,25 +112,13 @@ export default { methods: { availabilityOptionChanged(option) { if (option === 'specificUsers' && !this.users.length) { - this.loadUsers() + this.callLoadUsers() } }, - async loadUsers() { + async callLoadUsers() { this.processing = true - this.users = await this.$axios - .$get('/api/users') - .then((res) => { - return res.users.sort((a, b) => { - return a.createdAt - b.createdAt - }) - }) - .catch((error) => { - console.error('Failed', error) - return [] - }) - .finally(() => { - this.processing = false - }) + await this.loadUsers() + this.processing = false }, submitForm() { this.$refs.ereaderNameInput.blur() @@ -226,10 +218,6 @@ export default { this.newDevice.email = this.ereaderDevice.email this.newDevice.availabilityOption = this.ereaderDevice.availabilityOption || 'adminOrUp' this.newDevice.users = this.ereaderDevice.users || [] - - if (this.newDevice.availabilityOption === 'specificUsers' && !this.users.length) { - this.loadUsers() - } } else { this.newDevice.name = '' this.newDevice.email = '' diff --git a/client/components/modals/item/tabs/Match.vue b/client/components/modals/item/tabs/Match.vue index ed4db87af..9e2fe8bec 100644 --- a/client/components/modals/item/tabs/Match.vue +++ b/client/components/modals/item/tabs/Match.vue @@ -79,7 +79,7 @@
- +

{{ $strings.LabelCurrently }} {{ mediaMetadata.narratorName || '' }}

@@ -122,7 +122,7 @@
- +

{{ $strings.LabelCurrently }} {{ media.tags.join(', ') }}

@@ -280,6 +280,9 @@ export default { bookCoverAspectRatio() { return this.$store.getters['libraries/getBookCoverAspectRatio'] }, + filterData() { + return this.$store.state.libraries.filterData + }, providers() { if (this.isPodcast) return this.$store.state.scanners.podcastProviders return this.$store.state.scanners.providers @@ -305,11 +308,16 @@ export default { isPodcast() { return this.mediaType == 'podcast' }, + narrators() { + return this.filterData.narrators || [] + }, genres() { - const filterData = this.$store.state.libraries.filterData || {} - const currentGenres = filterData.genres || [] + const currentGenres = this.filterData.genres || [] const selectedMatchGenres = this.selectedMatch.genres || [] return [...new Set([...currentGenres, ...selectedMatchGenres])] + }, + tags() { + return this.filterData.tags || [] } }, methods: { @@ -479,6 +487,12 @@ export default { // match.genres = match.genres.join(',') match.genres = match.genres.split(',').map((g) => g.trim()) } + if (match.tags && !Array.isArray(match.tags)) { + match.tags = match.tags.split(',').map((g) => g.trim()) + } + if (match.narrator && !Array.isArray(match.narrator)) { + match.narrator = match.narrator.split(',').map((g) => g.trim()) + } } console.log('Select Match', match) @@ -522,11 +536,11 @@ export default { ) updatePayload.metadata.authors = authorPayload } else if (key === 'narrator') { - updatePayload.metadata.narrators = this.selectedMatch[key].split(',').map((v) => v.trim()) + updatePayload.metadata.narrators = this.selectedMatch[key] } else if (key === 'genres') { updatePayload.metadata.genres = [...this.selectedMatch[key]] } else if (key === 'tags') { - updatePayload.tags = this.selectedMatch[key].split(',').map((v) => v.trim()) + updatePayload.tags = this.selectedMatch[key] } else if (key === 'itunesId') { updatePayload.metadata.itunesId = Number(this.selectedMatch[key]) } else { diff --git a/client/components/modals/libraries/LibrarySettings.vue b/client/components/modals/libraries/LibrarySettings.vue index 4183c4fe4..3808ed07b 100644 --- a/client/components/modals/libraries/LibrarySettings.vue +++ b/client/components/modals/libraries/LibrarySettings.vue @@ -60,6 +60,17 @@
+
+
+ + +

+ {{ $strings.LabelSettingsEpubsAllowScriptedContent }} + info_outlined +

+
+
+
@@ -83,6 +94,7 @@ export default { skipMatchingMediaWithAsin: false, skipMatchingMediaWithIsbn: false, audiobooksOnly: false, + epubsAllowScriptedContent: false, hideSingleBookSeries: false, onlyShowLaterBooksInContinueSeries: false, podcastSearchRegion: 'us' @@ -118,6 +130,7 @@ export default { skipMatchingMediaWithAsin: !!this.skipMatchingMediaWithAsin, skipMatchingMediaWithIsbn: !!this.skipMatchingMediaWithIsbn, audiobooksOnly: !!this.audiobooksOnly, + epubsAllowScriptedContent: !!this.epubsAllowScriptedContent, hideSingleBookSeries: !!this.hideSingleBookSeries, onlyShowLaterBooksInContinueSeries: !!this.onlyShowLaterBooksInContinueSeries, podcastSearchRegion: this.podcastSearchRegion @@ -133,6 +146,7 @@ export default { this.skipMatchingMediaWithAsin = !!this.librarySettings.skipMatchingMediaWithAsin this.skipMatchingMediaWithIsbn = !!this.librarySettings.skipMatchingMediaWithIsbn this.audiobooksOnly = !!this.librarySettings.audiobooksOnly + this.epubsAllowScriptedContent = !!this.librarySettings.epubsAllowScriptedContent this.hideSingleBookSeries = !!this.librarySettings.hideSingleBookSeries this.onlyShowLaterBooksInContinueSeries = !!this.librarySettings.onlyShowLaterBooksInContinueSeries this.podcastSearchRegion = this.librarySettings.podcastSearchRegion || 'us' @@ -142,4 +156,4 @@ export default { this.init() } } - \ No newline at end of file + diff --git a/client/components/readers/EpubReader.vue b/client/components/readers/EpubReader.vue index 3941c0d81..819f5beb1 100644 --- a/client/components/readers/EpubReader.vue +++ b/client/components/readers/EpubReader.vue @@ -63,6 +63,9 @@ export default { libraryItemId() { return this.libraryItem?.id }, + allowScriptedContent() { + return this.$store.getters['libraries/getLibraryEpubsAllowScriptedContent'] + }, hasPrev() { return !this.rendition?.location?.atStart }, @@ -316,7 +319,7 @@ export default { reader.rendition = reader.book.renderTo('viewer', { width: this.readerWidth, height: this.readerHeight * 0.8, - allowScriptedContent: true, + allowScriptedContent: this.allowScriptedContent, spread: 'auto', snap: true, manager: 'continuous', diff --git a/client/components/tables/playlist/ItemTableRow.vue b/client/components/tables/playlist/ItemTableRow.vue index e5486461e..6899f600a 100644 --- a/client/components/tables/playlist/ItemTableRow.vue +++ b/client/components/tables/playlist/ItemTableRow.vue @@ -38,7 +38,7 @@
-
+
@@ -75,8 +75,7 @@ export default { }, computed: { translateDistance() { - if (!this.userCanUpdate && !this.userCanDelete) return 'translate-x-0' - else if (!this.userCanUpdate || !this.userCanDelete) return '-translate-x-12' + if (!this.userCanUpdate) return '-translate-x-12' return '-translate-x-24' }, libraryItem() { @@ -233,4 +232,4 @@ export default { }, mounted() {} } - \ No newline at end of file + diff --git a/client/components/ui/MultiSelect.vue b/client/components/ui/MultiSelect.vue index 516b062d5..337f501f5 100644 --- a/client/components/ui/MultiSelect.vue +++ b/client/components/ui/MultiSelect.vue @@ -302,6 +302,14 @@ export default { this.recalcMenuPos() }) }, + resetInput() { + this.textInput = null + this.currentSearch = null + this.selectedMenuItemIndex = null + this.$nextTick(() => { + this.blur() + }) + }, insertNewItem(item) { this.selected.push(item) this.$emit('input', this.selected) @@ -316,15 +324,18 @@ export default { submitForm() { if (!this.textInput) return - var cleaned = this.textInput.trim() - var matchesItem = this.items.find((i) => { - return i === cleaned - }) - if (matchesItem) { - this.clickedOption(null, matchesItem) + const cleaned = this.textInput.trim() + if (!cleaned) { + this.resetInput() } else { - this.insertNewItem(this.textInput) + const matchesItem = this.items.find((i) => i === cleaned) + if (matchesItem) { + this.clickedOption(null, matchesItem) + } else { + this.insertNewItem(cleaned) + } } + if (this.$refs.input) this.$refs.input.style.width = '24px' }, scroll() { @@ -352,4 +363,4 @@ input:read-only { color: #aaa; background-color: #444; } - \ No newline at end of file + diff --git a/client/components/ui/TimePicker.vue b/client/components/ui/TimePicker.vue index 9b34a6e82..f944ef5dd 100644 --- a/client/components/ui/TimePicker.vue +++ b/client/components/ui/TimePicker.vue @@ -1,5 +1,5 @@