This commit is contained in:
Finn Dittmar 2025-04-28 23:25:54 -04:00 committed by GitHub
commit 05edf09e5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 5 deletions

View File

@ -77,9 +77,14 @@
</div>
<!-- m4b embed action buttons -->
<div v-else class="w-full flex items-center mb-4">
<button :disabled="processing" class="text-sm uppercase text-gray-200 flex items-center pt-px pl-1 pr-2 hover:bg-white/5 rounded-md" @click="showEncodeOptions = !showEncodeOptions">
<span class="material-symbols text-xl">{{ showEncodeOptions || usingCustomEncodeOptions ? 'check_box' : 'check_box_outline_blank' }}</span> <span class="pl-1">{{ $strings.LabelUseAdvancedOptions }}</span>
</button>
<div class="flex flex-col items-start">
<button v-if="audioFiles.length > 1" :disabled="processing || showEncodeOptions || usingCustomEncodeOptions" :class="['text-sm uppercase flex items-center pt-px pl-1 pr-2 hover:bg-white/5 rounded-md mb-2', (processing || showEncodeOptions || usingCustomEncodeOptions) ? 'text-gray-400' : 'text-gray-200']" @click="mergeWithoutEncoding = !mergeWithoutEncoding">
<span class="material-symbols text-xl">{{ mergeWithoutEncoding ? 'check_box' : 'check_box_outline_blank' }}</span> <span class="pl-1">{{ $strings.LabelMergeWithoutEncoding }}</span>
</button>
<button :disabled="processing || mergeWithoutEncoding" :class="['text-sm uppercase flex items-center pt-px pl-1 pr-2 hover:bg-white/5 rounded-md', (processing || mergeWithoutEncoding || usingCustomEncodeOptions) ? 'text-gray-400' : 'text-gray-200']" @click="showEncodeOptions = !showEncodeOptions">
<span class="material-symbols text-xl">{{ showEncodeOptions || (usingCustomEncodeOptions && !mergeWithoutEncoding) ? 'check_box' : 'check_box_outline_blank' }}</span> <span class="pl-1">{{ $strings.LabelUseAdvancedOptions }}</span>
</button>
</div>
<div class="grow" />
@ -92,7 +97,7 @@
<!-- advanced encoding options -->
<div v-if="isM4BTool" class="overflow-hidden">
<transition name="slide">
<div v-if="showEncodeOptions || usingCustomEncodeOptions" class="mb-4 pb-4 border-b border-white/10">
<div v-if="(showEncodeOptions || usingCustomEncodeOptions) && !mergeWithoutEncoding" class="mb-4 pb-4 border-b border-white/10">
<div class="flex flex-wrap -mx-2">
<ui-text-input-with-label ref="bitrateInput" v-model="encodingOptions.bitrate" :disabled="processing || isTaskFinished" :label="$strings.LabelAudioBitrate" class="m-2 max-w-40" @input="bitrateChanged" />
<ui-text-input-with-label ref="channelsInput" v-model="encodingOptions.channels" :disabled="processing || isTaskFinished" :label="$strings.LabelAudioChannels" class="m-2 max-w-40" @input="channelsChanged" />
@ -216,6 +221,7 @@ export default {
isCancelingEncode: false,
showEncodeOptions: false,
shouldBackupAudioFiles: true,
mergeWithoutEncoding: false,
encodingOptions: {
bitrate: '128k',
channels: '2',
@ -352,7 +358,7 @@ export default {
if (this.$refs.codecInput) this.$refs.codecInput.blur()
let queryStr = ''
if (this.showEncodeOptions) {
if (this.showEncodeOptions && !this.mergeWithoutEncoding) {
const options = []
if (this.encodingOptions.bitrate) options.push(`bitrate=${this.encodingOptions.bitrate}`)
if (this.encodingOptions.channels) options.push(`channels=${this.encodingOptions.channels}`)
@ -360,6 +366,8 @@ export default {
if (options.length) {
queryStr = `?${options.join('&')}`
}
} else if (this.mergeWithoutEncoding) {
queryStr = '?codec=copy'
}
this.processing = true
this.$axios

View File

@ -432,6 +432,7 @@
"LabelMaxEpisodesToKeepHelp": "Value of 0 sets no max limit. After a new episode is auto-downloaded this will delete the oldest episode if you have more than X episodes. This will only delete 1 episode per new download.",
"LabelMediaPlayer": "Media Player",
"LabelMediaType": "Media Type",
"LabelMergeWithoutEncoding": "Merge files without encoding",
"LabelMetaTag": "Meta Tag",
"LabelMetaTags": "Meta Tags",
"LabelMetadataOrderOfPrecedenceDescription": "Higher priority metadata sources will override lower priority metadata sources",