web/settings/audio: disable bitrate section when not applicable (#802)

This commit is contained in:
lath 2024-10-05 17:40:56 +02:00 committed by GitHub
parent 4ed2df64b3
commit 4156206f35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -50,7 +50,7 @@
"audio.bitrate": "audio bitrate", "audio.bitrate": "audio bitrate",
"audio.bitrate.kbps": "kb/s", "audio.bitrate.kbps": "kb/s",
"audio.bitrate.description": "bitrate applies only to audio conversion. cobalt can't improve the source audio quality, so choosing a bitrate over 128kbps may inflate the file size with no audible difference. perceived quality may vary by format.", "audio.bitrate.description": "bitrate is applied only when converting audio to a lossy format. cobalt can't improve the source audio quality, so choosing a bitrate over 128kbps may inflate the file size with no audible difference. perceived quality may vary by format.",
"audio.youtube.dub": "youtube", "audio.youtube.dub": "youtube",
"audio.youtube.dub.title": "use browser language for dubbed videos", "audio.youtube.dub.title": "use browser language for dubbed videos",

View file

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import settings from "$lib/state/settings";
import { t } from "$lib/i18n/translations"; import { t } from "$lib/i18n/translations";
import { audioFormatOptions, audioBitrateOptions } from "$lib/types/settings"; import { audioFormatOptions, audioBitrateOptions } from "$lib/types/settings";
@ -23,7 +24,11 @@
</Switcher> </Switcher>
</SettingsCategory> </SettingsCategory>
<SettingsCategory sectionId="bitrate" title={$t("settings.audio.bitrate")}> <SettingsCategory
sectionId="bitrate"
title={$t("settings.audio.bitrate")}
disabled={["wav", "best"].includes($settings.save.audioFormat)}
>
<Switcher big={true} description={$t("settings.audio.bitrate.description")}> <Switcher big={true} description={$t("settings.audio.bitrate.description")}>
{#each audioBitrateOptions as value} {#each audioBitrateOptions as value}
<SettingsButton <SettingsButton