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">
|
2022-08-13 20:56:37 +02:00
|
|
|
<div class="flex items-center py-2">
|
|
|
|
<ui-toggle-switch v-model="useSquareBookCovers" @input="formUpdated" />
|
|
|
|
<ui-tooltip :text="tooltips.coverAspectRatio">
|
|
|
|
<p class="pl-4 text-base">
|
|
|
|
Use square book covers
|
|
|
|
<span class="material-icons icon-text text-sm">info_outlined</span>
|
|
|
|
</p>
|
|
|
|
</ui-tooltip>
|
|
|
|
</div>
|
2022-04-15 00:15:52 +02:00
|
|
|
<div class="py-3">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<ui-toggle-switch v-if="!globalWatcherDisabled" v-model="disableWatcher" @input="formUpdated" />
|
|
|
|
<ui-toggle-switch v-else disabled :value="false" />
|
2022-08-13 19:44:43 +02:00
|
|
|
<p class="pl-4 text-base">Disable folder watcher for library</p>
|
2022-04-15 00:15:52 +02:00
|
|
|
</div>
|
|
|
|
<p v-if="globalWatcherDisabled" class="text-xs text-warning">*Watcher is disabled globally in server settings</p>
|
|
|
|
</div>
|
2022-05-08 03:10:23 +02:00
|
|
|
<div v-if="mediaType == 'book'" 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-08-13 19:44:43 +02:00
|
|
|
<p class="pl-4 text-base">Skip matching books that already have an ASIN</p>
|
2022-04-27 02:36:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-05-08 03:10:23 +02:00
|
|
|
<div v-if="mediaType == 'book'" 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-08-13 19:44:43 +02:00
|
|
|
<p class="pl-4 text-base">Skip matching books that already have an ISBN</p>
|
2022-04-27 02:36:29 +02:00
|
|
|
</div>
|
|
|
|
</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,
|
2022-04-27 02:36:29 +02:00
|
|
|
disableWatcher: false,
|
|
|
|
skipMatchingMediaWithAsin: false,
|
2022-08-13 20:56:37 +02:00
|
|
|
skipMatchingMediaWithIsbn: false,
|
|
|
|
tooltips: {
|
|
|
|
coverAspectRatio: 'Prefer to use square covers over standard 1.6:1 book covers'
|
|
|
|
}
|
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
|
|
|
|
},
|
|
|
|
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,
|
2022-04-27 02:36:29 +02:00
|
|
|
disableWatcher: !!this.disableWatcher,
|
|
|
|
skipMatchingMediaWithAsin: !!this.skipMatchingMediaWithAsin,
|
|
|
|
skipMatchingMediaWithIsbn: !!this.skipMatchingMediaWithIsbn
|
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
|
2022-04-15 00:15:52 +02:00
|
|
|
this.disableWatcher = !!this.librarySettings.disableWatcher
|
2022-04-27 02:36:29 +02:00
|
|
|
this.skipMatchingMediaWithAsin = !!this.librarySettings.skipMatchingMediaWithAsin
|
|
|
|
this.skipMatchingMediaWithIsbn = !!this.librarySettings.skipMatchingMediaWithIsbn
|
2022-04-15 00:15:52 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.init()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|