From 94853f0b7b5852375fa46711ec67e373d488a583 Mon Sep 17 00:00:00 2001 From: wukko Date: Tue, 23 Jul 2024 12:34:14 +0600 Subject: [PATCH] web/FilenamePreview: finish the component --- web/i18n/en/settings.json | 2 +- .../settings/FilenamePreview.svelte | 83 +++++++++++++++++-- web/src/routes/settings/download/+page.svelte | 10 ++- 3 files changed, 84 insertions(+), 11 deletions(-) diff --git a/web/i18n/en/settings.json b/web/i18n/en/settings.json index 82bfb282..0127627b 100644 --- a/web/i18n/en/settings.json +++ b/web/i18n/en/settings.json @@ -63,7 +63,7 @@ "metadata.filename.basic": "basic", "metadata.filename.pretty": "pretty", "metadata.filename.nerdy": "nerdy", - "metadata.filename.description": "filename style using which cobalt files will be downloaded. this description is temporary as there's no dynamic preview component yet.", + "metadata.filename.description": "filename style will only be used for files processed or proxied by cobalt. some services don't support filename styles.", "metadata.filename.preview.video": "Video Title", "metadata.filename.preview.audio": "Audio Title - Audio Author", diff --git a/web/src/components/settings/FilenamePreview.svelte b/web/src/components/settings/FilenamePreview.svelte index 64fce4f4..829e1745 100644 --- a/web/src/components/settings/FilenamePreview.svelte +++ b/web/src/components/settings/FilenamePreview.svelte @@ -2,6 +2,9 @@ import settings from "$lib/state/settings"; import { t } from "$lib/i18n/translations"; + import IconMovie from "@tabler/icons-svelte/IconMovie.svelte"; + import IconMusic from "@tabler/icons-svelte/IconMusic.svelte"; + let videoFilePreview: string; let audioFilePreview: string; @@ -66,18 +69,86 @@
-
- {videoFilePreview}.{youtubeVideoExt} +
+
+ +
+
+
{`${videoFilePreview}.${youtubeVideoExt}`}
+
video file preview
+
-
- {audioFilePreview}.{audioFormat} +
+
+ +
+
+
{`${audioFilePreview}.${audioFormat}`}
+
audio file preview
+
diff --git a/web/src/routes/settings/download/+page.svelte b/web/src/routes/settings/download/+page.svelte index 1da7010f..6e6ea6f0 100644 --- a/web/src/routes/settings/download/+page.svelte +++ b/web/src/routes/settings/download/+page.svelte @@ -11,10 +11,7 @@ - + {#each filenameStyleOptions as value} {/each} + + +
+ {$t("settings.metadata.filename.description")} +