From 347b49f5645619f53144e92e2dec961f1d025b32 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 8 Oct 2023 17:10:43 -0500 Subject: [PATCH] Update:Remove scanner settings, add library scanner settings tab, add order of precedence --- .../components/modals/libraries/EditModal.vue | 16 +- .../libraries/LibraryScannerSettings.vue | 129 ++++++ .../components/tables/library/LibraryItem.vue | 13 +- client/pages/config/index.vue | 130 +++--- client/strings/de.json | 6 - client/strings/en-us.json | 8 +- client/strings/es.json | 8 +- client/strings/fr.json | 6 - client/strings/gu.json | 6 - client/strings/hi.json | 6 - client/strings/hr.json | 6 - client/strings/it.json | 6 - client/strings/lt.json | 6 - client/strings/nl.json | 8 +- client/strings/no.json | 6 - client/strings/pl.json | 6 - client/strings/ru.json | 6 - client/strings/zh-cn.json | 6 - server/controllers/LibraryController.js | 12 +- server/models/Library.js | 1 + server/objects/mediaTypes/Book.js | 211 ---------- server/objects/mediaTypes/Music.js | 4 - server/objects/mediaTypes/Podcast.js | 31 -- server/objects/settings/LibrarySettings.js | 17 +- server/objects/settings/ServerSettings.js | 9 - server/scanner/AbsMetadataFileScanner.js | 65 +++ server/scanner/AudioFileScanner.js | 202 ++++++++++ server/scanner/BookScanner.js | 379 ++++-------------- server/scanner/LibraryItemScanData.js | 36 +- server/scanner/LibraryItemScanner.js | 13 +- server/scanner/LibraryScanner.js | 33 +- server/scanner/OpfFileScanner.js | 48 +++ server/scanner/PodcastScanner.js | 19 +- .../parsers/parseOverdriveMediaMarkers.js | 33 +- server/utils/scandir.js | 82 ++-- 35 files changed, 764 insertions(+), 809 deletions(-) create mode 100644 client/components/modals/libraries/LibraryScannerSettings.vue create mode 100644 server/scanner/AbsMetadataFileScanner.js create mode 100644 server/scanner/OpfFileScanner.js diff --git a/client/components/modals/libraries/EditModal.vue b/client/components/modals/libraries/EditModal.vue index 633b7646..1fd011cf 100644 --- a/client/components/modals/libraries/EditModal.vue +++ b/client/components/modals/libraries/EditModal.vue @@ -54,6 +54,9 @@ export default { buttonText() { return this.library ? this.$strings.ButtonSave : this.$strings.ButtonCreate }, + mediaType() { + return this.libraryCopy?.mediaType + }, tabs() { return [ { @@ -66,12 +69,19 @@ export default { title: this.$strings.HeaderSettings, component: 'modals-libraries-library-settings' }, + { + id: 'scanner', + title: this.$strings.HeaderSettingsScanner, + component: 'modals-libraries-library-scanner-settings' + }, { id: 'schedule', title: this.$strings.HeaderSchedule, component: 'modals-libraries-schedule-scan' } - ] + ].filter((tab) => { + return tab.id !== 'scanner' || this.mediaType === 'book' + }) }, tabName() { var _tab = this.tabs.find((t) => t.id === this.selectedTab) @@ -105,7 +115,9 @@ export default { disableWatcher: false, skipMatchingMediaWithAsin: false, skipMatchingMediaWithIsbn: false, - autoScanCronExpression: null + autoScanCronExpression: null, + hideSingleBookSeries: false, + metadataPrecedence: ['folderStructure', 'audioMetatags', 'txtFiles', 'opfFile', 'absMetadata'] } } }, diff --git a/client/components/modals/libraries/LibraryScannerSettings.vue b/client/components/modals/libraries/LibraryScannerSettings.vue new file mode 100644 index 00000000..95ae801a --- /dev/null +++ b/client/components/modals/libraries/LibraryScannerSettings.vue @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/client/components/tables/library/LibraryItem.vue b/client/components/tables/library/LibraryItem.vue index b84dec44..cfb30a0c 100644 --- a/client/components/tables/library/LibraryItem.vue +++ b/client/components/tables/library/LibraryItem.vue @@ -74,6 +74,11 @@ export default { } ] if (this.isBookLibrary) { + items.push({ + text: this.$strings.ButtonForceReScan, + action: 'force-rescan', + value: 'force-rescan' + }) items.push({ text: this.$strings.ButtonMatchBooks, action: 'match-books', @@ -95,8 +100,8 @@ export default { this.editClick() } else if (action === 'scan') { this.scan() - } else if (action === 'force-scan') { - this.forceScan() + } else if (action === 'force-rescan') { + this.scan(true) } else if (action === 'match-books') { this.matchAll() } else if (action === 'delete') { @@ -121,9 +126,9 @@ export default { editClick() { this.$emit('edit', this.library) }, - scan() { + scan(force = false) { this.$store - .dispatch('libraries/requestLibraryScan', { libraryId: this.library.id }) + .dispatch('libraries/requestLibraryScan', { libraryId: this.library.id, force }) .then(() => { this.$toast.success(this.$strings.ToastLibraryScanStarted) }) diff --git a/client/pages/config/index.vue b/client/pages/config/index.vue index 67391141..936f6a30 100644 --- a/client/pages/config/index.vue +++ b/client/pages/config/index.vue @@ -51,6 +51,56 @@ +
+

{{ $strings.HeaderSettingsScanner }}

+
+ +
+ + +

+ {{ $strings.LabelSettingsParseSubtitles }} + info_outlined +

+
+
+ +
+ + +

+ {{ $strings.LabelSettingsFindCovers }} + info_outlined +

+
+
+
+
+ +
+ +
+ + +

+ {{ $strings.LabelSettingsPreferMatchedMetadata }} + info_outlined +

+
+
+ +
+ + +

+ {{ $strings.LabelSettingsEnableWatcher }} + info_outlined +

+
+
+
+ +

{{ $strings.HeaderSettingsDisplay }}

@@ -88,86 +138,6 @@
-
- -
-
-

{{ $strings.HeaderSettingsScanner }}

-
- -
- - -

- {{ $strings.LabelSettingsParseSubtitles }} - info_outlined -

-
-
- -
- - -

- {{ $strings.LabelSettingsFindCovers }} - info_outlined -

-
-
-
-
- -
- -
- - -

- {{ $strings.LabelSettingsOverdriveMediaMarkers }} - info_outlined -

-
-
- -
- - -

- {{ $strings.LabelSettingsPreferAudioMetadata }} - info_outlined -

-
-
- -
- - -

- {{ $strings.LabelSettingsPreferOPFMetadata }} - info_outlined -

-
-
- -
- - -

- {{ $strings.LabelSettingsPreferMatchedMetadata }} - info_outlined -

-
-
- -
- - -

- {{ $strings.LabelSettingsEnableWatcher }} - info_outlined -

-
-