Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Video-Downloader/web/src/routes/settings/audio/+page.svelte
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
77 lines (71 sloc)
2.57 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import settings from '$lib/state/settings'; | |
import { t } from '$lib/i18n/translations'; | |
import { namedYoutubeLanguages } from '$lib/settings/youtube-lang'; | |
import { | |
audioFormatOptions, | |
audioBitrateOptions, | |
} from '$lib/types/settings'; | |
import SettingsCategory from '$components/settings/SettingsCategory.svelte'; | |
import Switcher from '$components/buttons/Switcher.svelte'; | |
import SettingsButton from '$components/buttons/SettingsButton.svelte'; | |
import SettingsToggle from '$components/buttons/SettingsToggle.svelte'; | |
import SettingsDropdown from '$components/settings/SettingsDropdown.svelte'; | |
const displayLangs = namedYoutubeLanguages(); | |
</script> | |
<SettingsCategory sectionId="format" title={$t("settings.audio.format")}> | |
<Switcher big={true} description={$t("settings.audio.format.description")}> | |
{#each audioFormatOptions as value} | |
<SettingsButton | |
settingContext="save" | |
settingId="audioFormat" | |
settingValue={value} | |
> | |
{$t(`settings.audio.format.${value}`)} | |
</SettingsButton> | |
{/each} | |
</Switcher> | |
</SettingsCategory> | |
<SettingsCategory | |
sectionId="bitrate" | |
title={$t("settings.audio.bitrate")} | |
disabled={["wav", "best"].includes($settings.save.audioFormat)} | |
> | |
<Switcher big={true} description={$t("settings.audio.bitrate.description")}> | |
{#each audioBitrateOptions as value} | |
<SettingsButton | |
settingContext="save" | |
settingId="audioBitrate" | |
settingValue={value} | |
> | |
{value}{$t("settings.audio.bitrate.kbps")} | |
</SettingsButton> | |
{/each} | |
</Switcher> | |
</SettingsCategory> | |
<SettingsCategory | |
sectionId="youtube-dub" | |
title={$t("settings.audio.youtube.dub")} | |
beta | |
> | |
<SettingsDropdown | |
title={$t("settings.audio.youtube.dub.title")} | |
description={$t("settings.audio.youtube.dub.description")} | |
items={displayLangs} | |
settingContext="save" | |
settingId="youtubeDubLang" | |
selectedOption={$settings.save.youtubeDubLang} | |
selectedTitle={displayLangs[$settings.save.youtubeDubLang]} | |
/> | |
</SettingsCategory> | |
<SettingsCategory | |
sectionId="tiktok" | |
title={$t("settings.audio.tiktok.original")} | |
> | |
<SettingsToggle | |
settingContext="save" | |
settingId="tiktokFullAudio" | |
title={$t("settings.audio.tiktok.original.title")} | |
description={$t("settings.audio.tiktok.original.description")} | |
/> | |
</SettingsCategory> |