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