web/settings/local: transform the media processing setting to a switcher

This commit is contained in:
wukko 2025-06-22 16:29:47 +06:00
parent a4d5f5b380
commit 885398955f
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2
2 changed files with 19 additions and 9 deletions

View File

@ -143,9 +143,11 @@
"advanced.settings_data": "settings data", "advanced.settings_data": "settings data",
"advanced.local_storage": "local storage", "advanced.local_storage": "local storage",
"local.saving": "media processing", "local.saving": "local media processing",
"local.saving.title": "download & process media locally", "local.saving.description": "when downloading media, remuxing and transcoding will be done on-device instead of the cloud. you'll see detailed progress in the processing queue.\n\ndisabled: local processing will not be used. processing instances can enforce local processing, so this option may not have effect.\npreferred: media that requires extra processing will be downloaded through the processing queue, but the rest of media will be downloaded by your browser's download manager.\nforced: all media will always be proxied and downloaded through the processing queue.\n\nexclusive on-device features are not affected by this setting, they always run locally.",
"local.saving.description": "when downloading media, remuxing and transcoding will be done on-device instead of the cloud. you'll see detailed progress in the processing queue. processing instances may enforce this feature to save resources.\n\nexclusive on-device features are not affected by this toggle, they always run locally.", "local.saving.disabled": "disabled",
"local.saving.preferred": "preferred",
"local.saving.forced": "forced",
"local.webcodecs": "webcodecs", "local.webcodecs": "webcodecs",
"local.webcodecs.title": "use webcodecs for on-device processing", "local.webcodecs.title": "use webcodecs for on-device processing",

View File

@ -1,18 +1,26 @@
<script lang="ts"> <script lang="ts">
import env from "$lib/env"; import env from "$lib/env";
import { t } from "$lib/i18n/translations"; import { t } from "$lib/i18n/translations";
import { localProcessingOptions } from "$lib/types/settings";
import Switcher from "$components/buttons/Switcher.svelte";
import SettingsButton from "$components/buttons/SettingsButton.svelte";
import SettingsToggle from "$components/buttons/SettingsToggle.svelte"; import SettingsToggle from "$components/buttons/SettingsToggle.svelte";
import SettingsCategory from "$components/settings/SettingsCategory.svelte"; import SettingsCategory from "$components/settings/SettingsCategory.svelte";
</script> </script>
<SettingsCategory sectionId="media-processing" title={$t("settings.local.saving")} beta> <SettingsCategory sectionId="media-processing" title={$t("settings.local.saving")} beta>
<SettingsToggle <Switcher big={true} description={$t("settings.local.saving.description")}>
{#each localProcessingOptions as value}
<SettingsButton
settingContext="save" settingContext="save"
settingId="localProcessing" settingId="localProcessing"
title={$t("settings.local.saving.title")} settingValue={value}
description={$t("settings.local.saving.description")} >
/> {$t(`settings.local.saving.${value}`)}
</SettingsButton>
{/each}
</Switcher>
</SettingsCategory> </SettingsCategory>
{#if env.ENABLE_WEBCODECS} {#if env.ENABLE_WEBCODECS}