diff --git a/client/components/modals/libraries/EditModal.vue b/client/components/modals/libraries/EditModal.vue index 2a68dd639..641788b39 100644 --- a/client/components/modals/libraries/EditModal.vue +++ b/client/components/modals/libraries/EditModal.vue @@ -14,7 +14,7 @@
-
+
{{ buttonText }}
@@ -190,6 +190,15 @@ export default { } } else if (key === 'settings') { for (const settingsKey in this.libraryCopy.settings) { + console.log('Settings settings key', this.library.settings[settingsKey]) + if (this.libraryCopy.settings[settingsKey] !== this.library.settings[settingsKey]) { + if (!updatePayload.settings) updatePayload.settings = {} + updatePayload.settings[settingsKey] = this.libraryCopy.settings[settingsKey] + } + } + } else if (key === 'tools') { + for (const settingsKey in this.libraryCopy.settings) { + console.log('Tools settings key', this.library.settings[settingsKey]) if (this.libraryCopy.settings[settingsKey] !== this.library.settings[settingsKey]) { if (!updatePayload.settings) updatePayload.settings = {} updatePayload.settings[settingsKey] = this.libraryCopy.settings[settingsKey] diff --git a/client/components/modals/libraries/LibraryTools.vue b/client/components/modals/libraries/LibraryTools.vue index d8b65a7a2..61dd798cd 100644 --- a/client/components/modals/libraries/LibraryTools.vue +++ b/client/components/modals/libraries/LibraryTools.vue @@ -23,10 +23,10 @@
- +
- +
@@ -60,9 +60,6 @@ export default { isBookLibrary() { return this.mediaType === 'book' }, - bitrateType() { - return this.bitrateType - }, encodingPresets() { return [ { @@ -129,8 +126,14 @@ export default { .finally(() => { this.$emit('update:processing', false) }) + }, + init() { + this.bitrateType = this.librarySettings.bitrateType + this.fixedBitrate = this.librarySettings.fixedBitrate } }, - mounted() {} + mounted() { + this.init() + } } \ No newline at end of file diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 51efaef54..11ae30c24 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -214,6 +214,7 @@ "LabelBackupsNumberToKeep": "Number of backups to keep", "LabelBackupsNumberToKeepHelp": "Only 1 backup will be removed at a time so if you already have more backups than this you should manually remove them.", "LabelBitrate": "Bitrate", + "LabelBitrateType": "Bitrate Type", "LabelBooks": "Books", "LabelButtonText": "Button Text", "LabelChangePassword": "Change Password", diff --git a/server/models/Library.js b/server/models/Library.js index c6875ad7b..a7d3c3bf0 100644 --- a/server/models/Library.js +++ b/server/models/Library.js @@ -11,6 +11,7 @@ const oldLibrary = require('../objects/Library') * @property {string} autoScanCronExpression * @property {boolean} audiobooksOnly * @property {boolean} hideSingleBookSeries Do not show series that only have 1 book + * @property {boolean} bitrateType * @property {string[]} metadataPrecedence */ diff --git a/server/objects/settings/LibrarySettings.js b/server/objects/settings/LibrarySettings.js index 10ee19e02..5828aff01 100644 --- a/server/objects/settings/LibrarySettings.js +++ b/server/objects/settings/LibrarySettings.js @@ -9,6 +9,7 @@ class LibrarySettings { this.autoScanCronExpression = null this.audiobooksOnly = false this.hideSingleBookSeries = false // Do not show series that only have 1 book + this.bitrateType = 'maxBitrate' this.metadataPrecedence = ['folderStructure', 'audioMetatags', 'nfoFile', 'txtFiles', 'opfFile', 'absMetadata'] if (settings) { @@ -24,6 +25,7 @@ class LibrarySettings { this.autoScanCronExpression = settings.autoScanCronExpression || null this.audiobooksOnly = !!settings.audiobooksOnly this.hideSingleBookSeries = !!settings.hideSingleBookSeries + this.bitrateType = settings.bitrateType || 'maxBitrate' if (settings.metadataPrecedence) { this.metadataPrecedence = [...settings.metadataPrecedence] } else { @@ -41,6 +43,7 @@ class LibrarySettings { autoScanCronExpression: this.autoScanCronExpression, audiobooksOnly: this.audiobooksOnly, hideSingleBookSeries: this.hideSingleBookSeries, + bitrateType: this.bitrateType, metadataPrecedence: [...this.metadataPrecedence] } }