2022-04-15 00:15:52 +02:00
|
|
|
<template>
|
2022-08-18 02:19:01 +02:00
|
|
|
<div class="w-full h-full px-1 md:px-4 py-1 mb-4">
|
2023-06-10 19:46:57 +02:00
|
|
|
<div class="flex items-center py-3">
|
2022-08-13 20:56:37 +02:00
|
|
|
<ui-toggle-switch v-model="useSquareBookCovers" @input="formUpdated" />
|
2022-11-08 01:27:17 +01:00
|
|
|
<ui-tooltip :text="$strings.LabelSettingsSquareBookCoversHelp">
|
2022-08-13 20:56:37 +02:00
|
|
|
<p class="pl-4 text-base">
|
2022-11-08 01:27:17 +01:00
|
|
|
{{ $strings.LabelSettingsSquareBookCovers }}
|
2024-07-08 18:36:37 +02:00
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
2022-08-13 20:56:37 +02:00
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
2022-04-15 00:15:52 +02:00
|
|
|
<div class="py-3">
|
|
|
|
<div class="flex items-center">
|
2023-09-08 21:28:21 +02:00
|
|
|
<ui-toggle-switch v-if="!globalWatcherDisabled" v-model="enableWatcher" @input="formUpdated" />
|
2022-04-15 00:15:52 +02:00
|
|
|
<ui-toggle-switch v-else disabled :value="false" />
|
2023-09-08 21:28:21 +02:00
|
|
|
<p class="pl-4 text-base">{{ $strings.LabelSettingsEnableWatcherForLibrary }}</p>
|
2022-04-15 00:15:52 +02:00
|
|
|
</div>
|
2022-11-08 01:27:17 +01:00
|
|
|
<p v-if="globalWatcherDisabled" class="text-xs text-warning">*{{ $strings.MessageWatcherIsDisabledGlobally }}</p>
|
2022-04-15 00:15:52 +02:00
|
|
|
</div>
|
2023-06-10 19:46:57 +02:00
|
|
|
<div v-if="isBookLibrary" class="flex items-center py-3">
|
|
|
|
<ui-toggle-switch v-model="audiobooksOnly" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsAudiobooksOnlyHelp">
|
|
|
|
<p class="pl-4 text-base">
|
|
|
|
{{ $strings.LabelSettingsAudiobooksOnly }}
|
2024-07-08 18:36:37 +02:00
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
2023-06-10 19:46:57 +02:00
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
|
|
|
<div v-if="isBookLibrary" class="py-3">
|
2022-04-27 02:36:29 +02:00
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="skipMatchingMediaWithAsin" @input="formUpdated" />
|
2022-11-08 01:27:17 +01:00
|
|
|
<p class="pl-4 text-base">{{ $strings.LabelSettingsSkipMatchingBooksWithASIN }}</p>
|
2022-04-27 02:36:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-06-10 19:46:57 +02:00
|
|
|
<div v-if="isBookLibrary" class="py-3">
|
2022-04-27 02:36:29 +02:00
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="skipMatchingMediaWithIsbn" @input="formUpdated" />
|
2022-11-08 01:27:17 +01:00
|
|
|
<p class="pl-4 text-base">{{ $strings.LabelSettingsSkipMatchingBooksWithISBN }}</p>
|
2022-04-27 02:36:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-06-30 00:55:17 +02:00
|
|
|
<div v-if="isBookLibrary" class="py-3">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="hideSingleBookSeries" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsHideSingleBookSeriesHelp">
|
|
|
|
<p class="pl-4 text-base">
|
|
|
|
{{ $strings.LabelSettingsHideSingleBookSeries }}
|
2024-07-08 18:36:37 +02:00
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
2023-06-30 00:55:17 +02:00
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-12 17:00:21 +01:00
|
|
|
<div v-if="isBookLibrary" class="py-3">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="onlyShowLaterBooksInContinueSeries" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsOnlyShowLaterBooksInContinueSeriesHelp">
|
|
|
|
<p class="pl-4 text-base">
|
|
|
|
{{ $strings.LabelSettingsOnlyShowLaterBooksInContinueSeries }}
|
2024-07-08 18:36:37 +02:00
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
2024-03-12 17:00:21 +01:00
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-05-26 23:01:08 +02:00
|
|
|
<div v-if="isBookLibrary" class="py-3">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="epubsAllowScriptedContent" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsEpubsAllowScriptedContentHelp">
|
|
|
|
<p class="pl-4 text-base">
|
|
|
|
{{ $strings.LabelSettingsEpubsAllowScriptedContent }}
|
2024-07-08 18:36:37 +02:00
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
2024-05-26 23:01:08 +02:00
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-05 07:45:35 +01:00
|
|
|
<div v-if="isPodcastLibrary" class="py-3">
|
2024-04-25 00:37:04 +02:00
|
|
|
<ui-dropdown :label="$strings.LabelPodcastSearchRegion" v-model="podcastSearchRegion" :items="$podcastSearchRegionOptions" small class="max-w-72" menu-max-height="200px" @input="formUpdated" />
|
2024-01-05 07:45:35 +01:00
|
|
|
</div>
|
2022-04-15 00:15:52 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
library: {
|
|
|
|
type: Object,
|
|
|
|
default: () => null
|
|
|
|
},
|
|
|
|
processing: Boolean
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
provider: null,
|
2022-08-13 20:56:37 +02:00
|
|
|
useSquareBookCovers: false,
|
2023-09-08 21:28:21 +02:00
|
|
|
enableWatcher: false,
|
2022-04-27 02:36:29 +02:00
|
|
|
skipMatchingMediaWithAsin: false,
|
2023-06-10 19:46:57 +02:00
|
|
|
skipMatchingMediaWithIsbn: false,
|
2023-06-30 00:55:17 +02:00
|
|
|
audiobooksOnly: false,
|
2024-05-26 23:01:08 +02:00
|
|
|
epubsAllowScriptedContent: false,
|
2024-01-05 07:45:35 +01:00
|
|
|
hideSingleBookSeries: false,
|
2024-03-12 17:00:21 +01:00
|
|
|
onlyShowLaterBooksInContinueSeries: false,
|
2024-01-05 07:45:35 +01:00
|
|
|
podcastSearchRegion: 'us'
|
2022-04-15 00:15:52 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
librarySettings() {
|
|
|
|
return this.library.settings || {}
|
|
|
|
},
|
|
|
|
globalWatcherDisabled() {
|
|
|
|
return this.$store.getters['getServerSetting']('scannerDisableWatcher')
|
|
|
|
},
|
|
|
|
mediaType() {
|
|
|
|
return this.library.mediaType
|
|
|
|
},
|
2023-06-10 19:46:57 +02:00
|
|
|
isBookLibrary() {
|
|
|
|
return this.mediaType === 'book'
|
|
|
|
},
|
2024-01-05 07:45:35 +01:00
|
|
|
isPodcastLibrary() {
|
|
|
|
return this.mediaType === 'podcast'
|
|
|
|
},
|
2022-04-15 00:15:52 +02:00
|
|
|
providers() {
|
|
|
|
if (this.mediaType === 'podcast') return this.$store.state.scanners.podcastProviders
|
|
|
|
return this.$store.state.scanners.providers
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getLibraryData() {
|
|
|
|
return {
|
|
|
|
settings: {
|
2022-08-13 20:56:37 +02:00
|
|
|
coverAspectRatio: this.useSquareBookCovers ? this.$constants.BookCoverAspectRatio.SQUARE : this.$constants.BookCoverAspectRatio.STANDARD,
|
2023-09-08 21:28:21 +02:00
|
|
|
disableWatcher: !this.enableWatcher,
|
2022-04-27 02:36:29 +02:00
|
|
|
skipMatchingMediaWithAsin: !!this.skipMatchingMediaWithAsin,
|
2023-06-10 19:46:57 +02:00
|
|
|
skipMatchingMediaWithIsbn: !!this.skipMatchingMediaWithIsbn,
|
2023-06-30 00:55:17 +02:00
|
|
|
audiobooksOnly: !!this.audiobooksOnly,
|
2024-05-26 23:01:08 +02:00
|
|
|
epubsAllowScriptedContent: !!this.epubsAllowScriptedContent,
|
2024-01-05 07:45:35 +01:00
|
|
|
hideSingleBookSeries: !!this.hideSingleBookSeries,
|
2024-03-12 17:00:21 +01:00
|
|
|
onlyShowLaterBooksInContinueSeries: !!this.onlyShowLaterBooksInContinueSeries,
|
2024-01-05 07:45:35 +01:00
|
|
|
podcastSearchRegion: this.podcastSearchRegion
|
2022-04-15 00:15:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
formUpdated() {
|
|
|
|
this.$emit('update', this.getLibraryData())
|
|
|
|
},
|
|
|
|
init() {
|
2022-08-13 20:56:37 +02:00
|
|
|
this.useSquareBookCovers = this.librarySettings.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE
|
2023-09-08 21:28:21 +02:00
|
|
|
this.enableWatcher = !this.librarySettings.disableWatcher
|
2022-04-27 02:36:29 +02:00
|
|
|
this.skipMatchingMediaWithAsin = !!this.librarySettings.skipMatchingMediaWithAsin
|
|
|
|
this.skipMatchingMediaWithIsbn = !!this.librarySettings.skipMatchingMediaWithIsbn
|
2023-06-10 19:46:57 +02:00
|
|
|
this.audiobooksOnly = !!this.librarySettings.audiobooksOnly
|
2024-05-26 23:01:08 +02:00
|
|
|
this.epubsAllowScriptedContent = !!this.librarySettings.epubsAllowScriptedContent
|
2024-01-05 08:50:20 +01:00
|
|
|
this.hideSingleBookSeries = !!this.librarySettings.hideSingleBookSeries
|
2024-03-12 17:00:21 +01:00
|
|
|
this.onlyShowLaterBooksInContinueSeries = !!this.librarySettings.onlyShowLaterBooksInContinueSeries
|
2024-01-05 08:50:20 +01:00
|
|
|
this.podcastSearchRegion = this.librarySettings.podcastSearchRegion || 'us'
|
2022-04-15 00:15:52 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.init()
|
|
|
|
}
|
|
|
|
}
|
2024-05-26 23:01:08 +02:00
|
|
|
</script>
|