minor fixes to not export default format
This commit is contained in:
parent
fc696b6afa
commit
83152f0e00
3 changed files with 18 additions and 19 deletions
|
|
@ -129,7 +129,7 @@ class YTDLPOpts(metaclass=Singleton):
|
||||||
self.presets_opts = {}
|
self.presets_opts = {}
|
||||||
self._item_opts = {}
|
self._item_opts = {}
|
||||||
|
|
||||||
if "format" in data and "not_set" == data["format"]:
|
if "format" in data and data["format"] in ["not_set", "default"]:
|
||||||
data["format"] = None
|
data["format"] = None
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,7 @@
|
||||||
<span>The yt-dlp <code>[--format, -f]</code> video format code. see <NuxtLink
|
<span>The yt-dlp <code>[--format, -f]</code> video format code. see <NuxtLink
|
||||||
href="https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#format-selection" target="blank">this
|
href="https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#format-selection" target="blank">this
|
||||||
url</NuxtLink> for more info.</span>. Note, as this key is required, you can set the value to
|
url</NuxtLink> for more info.</span>. Note, as this key is required, you can set the value to
|
||||||
<code>not_set</code>
|
<code>default</code> to let <code>yt-dlp</code> choose the best format.
|
||||||
to use the default yt-dlp format.
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -223,19 +222,19 @@
|
||||||
|
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<div class="card-footer-item">
|
<div class="card-footer-item">
|
||||||
<button class="button is-fullwidth is-primary" :disabled="addInProgress" type="submit"
|
<button class="button is-fullwidth is-primary" :disabled="addInProgress" type="submit"
|
||||||
:class="{ 'is-loading': addInProgress }" form="presetForm">
|
:class="{ 'is-loading': addInProgress }" form="presetForm">
|
||||||
<span class="icon"><i class="fa-solid fa-save" /></span>
|
<span class="icon"><i class="fa-solid fa-save" /></span>
|
||||||
<span>Save</span>
|
<span>Save</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer-item">
|
<div class="card-footer-item">
|
||||||
<button class="button is-fullwidth is-danger" @click="emitter('cancel')" :disabled="addInProgress"
|
<button class="button is-fullwidth is-danger" @click="emitter('cancel')" :disabled="addInProgress"
|
||||||
type="button">
|
type="button">
|
||||||
<span class="icon"><i class="fa-solid fa-times" /></span>
|
<span class="icon"><i class="fa-solid fa-times" /></span>
|
||||||
<span>Cancel</span>
|
<span>Cancel</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -386,8 +386,8 @@ const exportItem = async item => {
|
||||||
args[key] = preset.args[key]
|
args[key] = preset.args[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const defaults = ['default', 'not_set']
|
||||||
if (preset.format !== 'not_set' && preset.format) {
|
if (preset.format && !defaults.includes(info.format)) {
|
||||||
args.format = preset.format
|
args.format = preset.format
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -421,7 +421,7 @@ const exportItem = async item => {
|
||||||
}
|
}
|
||||||
|
|
||||||
data['_type'] = 'task'
|
data['_type'] = 'task'
|
||||||
data['_version'] = '1.0'
|
data['_version'] = '1.1'
|
||||||
|
|
||||||
return copyText(base64UrlEncode(JSON.stringify(data)));
|
return copyText(base64UrlEncode(JSON.stringify(data)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue