mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-15 13:51:35 +00:00
Added save button to Tools tab
Still working on getting the default bitrate to be persistent
This commit is contained in:
parent
5b85d01d55
commit
71ab302d11
5 changed files with 24 additions and 7 deletions
|
|
@ -14,7 +14,7 @@
|
||||||
<div class="px-2 md:px-4 w-full text-sm pt-2 md:pt-6 pb-20 rounded-b-lg rounded-tr-lg bg-bg shadow-lg border border-black-300 relative overflow-hidden" style="min-height: 400px; max-height: 80vh">
|
<div class="px-2 md:px-4 w-full text-sm pt-2 md:pt-6 pb-20 rounded-b-lg rounded-tr-lg bg-bg shadow-lg border border-black-300 relative overflow-hidden" style="min-height: 400px; max-height: 80vh">
|
||||||
<component v-if="libraryCopy && show" ref="tabComponent" :is="tabName" :is-new="!library" :library="libraryCopy" :library-id="libraryId" :processing.sync="processing" @update="updateLibrary" @close="show = false" />
|
<component v-if="libraryCopy && show" ref="tabComponent" :is="tabName" :is-new="!library" :library="libraryCopy" :library-id="libraryId" :processing.sync="processing" @update="updateLibrary" @close="show = false" />
|
||||||
|
|
||||||
<div v-show="selectedTab !== 'tools'" class="absolute bottom-0 left-0 w-full px-4 py-4 border-t border-white border-opacity-10">
|
<div class="absolute bottom-0 left-0 w-full px-4 py-4 border-t border-white border-opacity-10">
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<ui-btn @click="submit">{{ buttonText }}</ui-btn>
|
<ui-btn @click="submit">{{ buttonText }}</ui-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -190,6 +190,15 @@ export default {
|
||||||
}
|
}
|
||||||
} else if (key === 'settings') {
|
} else if (key === 'settings') {
|
||||||
for (const settingsKey in this.libraryCopy.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 (this.libraryCopy.settings[settingsKey] !== this.library.settings[settingsKey]) {
|
||||||
if (!updatePayload.settings) updatePayload.settings = {}
|
if (!updatePayload.settings) updatePayload.settings = {}
|
||||||
updatePayload.settings[settingsKey] = this.libraryCopy.settings[settingsKey]
|
updatePayload.settings[settingsKey] = this.libraryCopy.settings[settingsKey]
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-grow" />
|
<div class="flex-grow" />
|
||||||
<div class="w-1/7 md:w-42 px-1 py-1 md:py-0">
|
<div class="w-1/7 md:w-42 px-1 py-1 md:py-0">
|
||||||
<ui-dropdown v-model="bitrateType" :items="encodingPresets" :label="$strings.LabelMediaType" small @input="changedEncodingPresets" />
|
<ui-dropdown v-model="bitrateType" :items="encodingPresets" :label="$strings.LabelBitrateType" small @input="changedEncodingPresets" />
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/8 md:w-42 px-1 py-1 md:py-0">
|
<div class="w-1/8 md:w-42 px-1 py-1 md:py-0">
|
||||||
<ui-text-input-with-label ref="nameInput" v-model="fixedBitrate" :disabled="!isFixedBitrate" :label="$strings.LabelLibraryName" />
|
<ui-text-input-with-label ref="nameInput" v-model="fixedBitrate" :disabled="!isFixedBitrate" :label="$strings.LabelBitrate" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -60,9 +60,6 @@ export default {
|
||||||
isBookLibrary() {
|
isBookLibrary() {
|
||||||
return this.mediaType === 'book'
|
return this.mediaType === 'book'
|
||||||
},
|
},
|
||||||
bitrateType() {
|
|
||||||
return this.bitrateType
|
|
||||||
},
|
|
||||||
encodingPresets() {
|
encodingPresets() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|
@ -129,8 +126,14 @@ export default {
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.$emit('update:processing', false)
|
this.$emit('update:processing', false)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
this.bitrateType = this.librarySettings.bitrateType
|
||||||
|
this.fixedBitrate = this.librarySettings.fixedBitrate
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {}
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -214,6 +214,7 @@
|
||||||
"LabelBackupsNumberToKeep": "Number of backups to keep",
|
"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.",
|
"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",
|
"LabelBitrate": "Bitrate",
|
||||||
|
"LabelBitrateType": "Bitrate Type",
|
||||||
"LabelBooks": "Books",
|
"LabelBooks": "Books",
|
||||||
"LabelButtonText": "Button Text",
|
"LabelButtonText": "Button Text",
|
||||||
"LabelChangePassword": "Change Password",
|
"LabelChangePassword": "Change Password",
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ const oldLibrary = require('../objects/Library')
|
||||||
* @property {string} autoScanCronExpression
|
* @property {string} autoScanCronExpression
|
||||||
* @property {boolean} audiobooksOnly
|
* @property {boolean} audiobooksOnly
|
||||||
* @property {boolean} hideSingleBookSeries Do not show series that only have 1 book
|
* @property {boolean} hideSingleBookSeries Do not show series that only have 1 book
|
||||||
|
* @property {boolean} bitrateType
|
||||||
* @property {string[]} metadataPrecedence
|
* @property {string[]} metadataPrecedence
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ class LibrarySettings {
|
||||||
this.autoScanCronExpression = null
|
this.autoScanCronExpression = null
|
||||||
this.audiobooksOnly = false
|
this.audiobooksOnly = false
|
||||||
this.hideSingleBookSeries = false // Do not show series that only have 1 book
|
this.hideSingleBookSeries = false // Do not show series that only have 1 book
|
||||||
|
this.bitrateType = 'maxBitrate'
|
||||||
this.metadataPrecedence = ['folderStructure', 'audioMetatags', 'nfoFile', 'txtFiles', 'opfFile', 'absMetadata']
|
this.metadataPrecedence = ['folderStructure', 'audioMetatags', 'nfoFile', 'txtFiles', 'opfFile', 'absMetadata']
|
||||||
|
|
||||||
if (settings) {
|
if (settings) {
|
||||||
|
|
@ -24,6 +25,7 @@ class LibrarySettings {
|
||||||
this.autoScanCronExpression = settings.autoScanCronExpression || null
|
this.autoScanCronExpression = settings.autoScanCronExpression || null
|
||||||
this.audiobooksOnly = !!settings.audiobooksOnly
|
this.audiobooksOnly = !!settings.audiobooksOnly
|
||||||
this.hideSingleBookSeries = !!settings.hideSingleBookSeries
|
this.hideSingleBookSeries = !!settings.hideSingleBookSeries
|
||||||
|
this.bitrateType = settings.bitrateType || 'maxBitrate'
|
||||||
if (settings.metadataPrecedence) {
|
if (settings.metadataPrecedence) {
|
||||||
this.metadataPrecedence = [...settings.metadataPrecedence]
|
this.metadataPrecedence = [...settings.metadataPrecedence]
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -41,6 +43,7 @@ class LibrarySettings {
|
||||||
autoScanCronExpression: this.autoScanCronExpression,
|
autoScanCronExpression: this.autoScanCronExpression,
|
||||||
audiobooksOnly: this.audiobooksOnly,
|
audiobooksOnly: this.audiobooksOnly,
|
||||||
hideSingleBookSeries: this.hideSingleBookSeries,
|
hideSingleBookSeries: this.hideSingleBookSeries,
|
||||||
|
bitrateType: this.bitrateType,
|
||||||
metadataPrecedence: [...this.metadataPrecedence]
|
metadataPrecedence: [...this.metadataPrecedence]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue