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">
|
2024-10-24 00:11:41 +02:00
|
|
|
<div class="flex flex-wrap">
|
|
|
|
<div class="flex items-center p-2 w-full md:w-1/2">
|
|
|
|
<ui-toggle-switch v-model="useSquareBookCovers" size="sm" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsSquareBookCoversHelp">
|
|
|
|
<p class="pl-4 text-sm">
|
|
|
|
{{ $strings.LabelSettingsSquareBookCovers }}
|
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>
|
2024-10-24 00:11:41 +02:00
|
|
|
<div class="p-2 w-full md:w-1/2">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-if="!globalWatcherDisabled" v-model="enableWatcher" size="sm" @input="formUpdated" />
|
|
|
|
<ui-toggle-switch v-else disabled size="sm" :value="false" />
|
|
|
|
<p class="pl-4 text-sm">{{ $strings.LabelSettingsEnableWatcherForLibrary }}</p>
|
|
|
|
</div>
|
|
|
|
<p v-if="globalWatcherDisabled" class="text-xs text-warning">*{{ $strings.MessageWatcherIsDisabledGlobally }}</p>
|
2024-03-12 17:00:21 +01:00
|
|
|
</div>
|
2024-10-24 00:11:41 +02:00
|
|
|
<div v-if="isBookLibrary" class="flex items-center p-2 w-full md:w-1/2">
|
|
|
|
<ui-toggle-switch v-model="audiobooksOnly" size="sm" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsAudiobooksOnlyHelp">
|
|
|
|
<p class="pl-4 text-sm">
|
|
|
|
{{ $strings.LabelSettingsAudiobooksOnly }}
|
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>
|
2024-10-24 00:11:41 +02:00
|
|
|
<div v-if="isBookLibrary" class="p-2 w-full md:w-1/2">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="skipMatchingMediaWithAsin" size="sm" @input="formUpdated" />
|
|
|
|
<p class="pl-4 text-sm">{{ $strings.LabelSettingsSkipMatchingBooksWithASIN }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="isBookLibrary" class="p-2 w-full md:w-1/2">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="skipMatchingMediaWithIsbn" size="sm" @input="formUpdated" />
|
|
|
|
<p class="pl-4 text-sm">{{ $strings.LabelSettingsSkipMatchingBooksWithISBN }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="isBookLibrary" class="p-2 w-full md:w-1/2">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="hideSingleBookSeries" size="sm" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsHideSingleBookSeriesHelp">
|
|
|
|
<p class="pl-4 text-sm">
|
|
|
|
{{ $strings.LabelSettingsHideSingleBookSeries }}
|
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="isBookLibrary" class="p-2 w-full md:w-1/2">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="onlyShowLaterBooksInContinueSeries" size="sm" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsOnlyShowLaterBooksInContinueSeriesHelp">
|
|
|
|
<p class="pl-4 text-sm">
|
|
|
|
{{ $strings.LabelSettingsOnlyShowLaterBooksInContinueSeries }}
|
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="isBookLibrary" class="p-2 w-full md:w-1/2">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-model="epubsAllowScriptedContent" size="sm" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="$strings.LabelSettingsEpubsAllowScriptedContentHelp">
|
|
|
|
<p class="pl-4 text-sm">
|
|
|
|
{{ $strings.LabelSettingsEpubsAllowScriptedContent }}
|
|
|
|
<span class="material-symbols icon-text text-sm">info</span>
|
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="isPodcastLibrary" class="p-2 w-full md:w-1/2">
|
|
|
|
<ui-dropdown :label="$strings.LabelPodcastSearchRegion" v-model="podcastSearchRegion" :items="$podcastSearchRegionOptions" small class="max-w-72" menu-max-height="200px" @input="formUpdated" />
|
|
|
|
</div>
|
2024-10-25 00:19:51 +02:00
|
|
|
<div class="p-2 w-full flex items-center space-x-2 flex-wrap">
|
|
|
|
<div>
|
|
|
|
<ui-dropdown v-model="markAsFinishedWhen" :items="maskAsFinishedWhenItems" :label="$strings.LabelSettingsLibraryMarkAsFinishedWhen" small class="w-72 min-w-72 text-sm" menu-max-height="200px" @input="markAsFinishedWhenChanged" />
|
|
|
|
</div>
|
|
|
|
<div class="w-16">
|
|
|
|
<div>
|
|
|
|
<label class="px-1 text-sm font-semibold"></label>
|
|
|
|
<div class="relative">
|
|
|
|
<ui-text-input v-model="markAsFinishedValue" type="number" label="" no-spinner custom-input-class="pr-5" @input="markAsFinishedChanged" />
|
|
|
|
<div class="absolute top-0 bottom-0 right-4 flex items-center">{{ markAsFinishedWhen === 'timeRemaining' ? '' : '%' }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
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-10-25 00:19:51 +02:00
|
|
|
podcastSearchRegion: 'us',
|
|
|
|
markAsFinishedWhen: 'timeRemaining',
|
|
|
|
markAsFinishedValue: 10
|
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
|
2024-10-25 00:19:51 +02:00
|
|
|
},
|
|
|
|
maskAsFinishedWhenItems() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
text: this.$strings.LabelSettingsLibraryMarkAsFinishedTimeRemaining,
|
|
|
|
value: 'timeRemaining'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: this.$strings.LabelSettingsLibraryMarkAsFinishedPercentComplete,
|
|
|
|
value: 'percentComplete'
|
|
|
|
}
|
|
|
|
]
|
2022-04-15 00:15:52 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2024-10-25 00:19:51 +02:00
|
|
|
markAsFinishedWhenChanged(val) {
|
|
|
|
if (val === 'percentComplete' && this.markAsFinishedValue > 100) {
|
|
|
|
this.markAsFinishedValue = 100
|
|
|
|
}
|
|
|
|
this.formUpdated()
|
|
|
|
},
|
|
|
|
markAsFinishedChanged(val) {
|
|
|
|
this.formUpdated()
|
|
|
|
},
|
2022-04-15 00:15:52 +02:00
|
|
|
getLibraryData() {
|
2024-10-25 00:19:51 +02:00
|
|
|
let markAsFinishedTimeRemaining = this.markAsFinishedWhen === 'timeRemaining' ? Number(this.markAsFinishedValue) : null
|
|
|
|
let markAsFinishedPercentComplete = this.markAsFinishedWhen === 'percentComplete' ? Number(this.markAsFinishedValue) : null
|
|
|
|
|
2022-04-15 00:15:52 +02:00
|
|
|
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-10-25 00:19:51 +02:00
|
|
|
podcastSearchRegion: this.podcastSearchRegion,
|
|
|
|
markAsFinishedTimeRemaining: markAsFinishedTimeRemaining,
|
|
|
|
markAsFinishedPercentComplete: markAsFinishedPercentComplete
|
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'
|
2024-10-25 00:19:51 +02:00
|
|
|
this.markAsFinishedWhen = this.librarySettings.markAsFinishedTimeRemaining ? 'timeRemaining' : 'percentComplete'
|
|
|
|
if (!this.librarySettings.markAsFinishedTimeRemaining && !this.librarySettings.markAsFinishedPercentComplete) {
|
|
|
|
this.markAsFinishedWhen = 'timeRemaining'
|
|
|
|
}
|
|
|
|
this.markAsFinishedValue = this.librarySettings.markAsFinishedTimeRemaining || this.librarySettings.markAsFinishedPercentComplete || 10
|
2022-04-15 00:15:52 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.init()
|
|
|
|
}
|
|
|
|
}
|
2024-05-26 23:01:08 +02:00
|
|
|
</script>
|