Added save button to Tools tab

Still working on getting the default bitrate to be persistent
This commit is contained in:
Nicholas W 2024-01-19 17:32:11 +00:00
parent 5b85d01d55
commit 71ab302d11
5 changed files with 24 additions and 7 deletions

View file

@ -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">
<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">
<ui-btn @click="submit">{{ buttonText }}</ui-btn>
</div>
@ -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]

View file

@ -23,10 +23,10 @@
</div>
<div class="flex-grow" />
<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 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>
@ -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()
}
}
</script>