Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
feat(ui): align home flow with v1-hero, add 4k/2k quality picker, and video mode
IGECTbbe0468779cc
diff --git a/src-tauri/omniget-core/src/platforms/twitch.rs b/src-tauri/omniget-core/src/platforms/twitch.rsindex ee4fff37..f6b12c12 100644--- a/src-tauri/omniget-core/src/platforms/twitch.rs+++ b/src-tauri/omniget-core/src/platforms/twitch.rs@@ -297,6 +297,15 @@ impl PlatformDownloader for TwitchClipsDownloader {opts: &DownloadOptions,progress: mpsc::Sender<ProgressUpdate>,) -> anyhow::Result<DownloadResult> {+ let requested_height = opts.quality.as_deref().and_then(|s| {+ let trimmed = s.trim().to_lowercase();+ if trimmed == "best" || trimmed == "highest" {+ None+ } else {+ trimmed.trim_end_matches('p').parse::<u32>().ok()+ }+ });+if let Some(quality) = info.available_qualities.first() {if quality.format == "ytdlp" {let ytdlp_path = crate::core::ytdlp::ensure_ytdlp().await?;@@ -304,7 +313,7 @@ impl PlatformDownloader for TwitchClipsDownloader {&ytdlp_path,&quality.url,&opts.output_dir,- None,+ requested_height,progress,opts.download_mode.as_deref(),opts.format_id.as_deref(),@@ -326,13 +335,23 @@ impl PlatformDownloader for TwitchClipsDownloader {.first().ok_or_else(|| anyhow!("No media URL available"))?;- let selected = if let Some(ref wanted) = opts.quality {- info.available_qualities+ let selected = match requested_height {+ Some(h) => info+ .available_qualities.iter()- .find(|q| q.label == *wanted)- .unwrap_or(first)- } else {- first+ .filter(|q| q.height > 0 && q.height <= h)+ .max_by_key(|q| q.height)+ .unwrap_or(first),+ None => {+ if let Some(ref wanted) = opts.quality {+ info.available_qualities+ .iter()+ .find(|q| q.label == *wanted)+ .unwrap_or(first)+ } else {+ first+ }+ }};let filename = format!(diff --git a/src-tauri/omniget-core/src/platforms/vimeo.rs b/src-tauri/omniget-core/src/platforms/vimeo.rsindex 1499d325..be375c63 100644--- a/src-tauri/omniget-core/src/platforms/vimeo.rs+++ b/src-tauri/omniget-core/src/platforms/vimeo.rs@@ -149,16 +149,32 @@ impl PlatformDownloader for VimeoDownloader {.first().ok_or_else(|| anyhow!("No quality available"))?;- let selected = if let Some(ref wanted) = opts.quality {- info.available_qualities+ let requested_height = opts+ .quality+ .as_deref()+ .and_then(Self::extract_quality_height);++ let selected = match requested_height {+ Some(h) => info+ .available_qualities.iter()- .find(|q| q.label == *wanted)- .unwrap_or(first)- } else {- first+ .filter(|q| q.height > 0 && q.height <= h)+ .max_by_key(|q| q.height)+ .unwrap_or(first),+ None => {+ if let Some(ref wanted) = opts.quality {+ info.available_qualities+ .iter()+ .find(|q| q.label == *wanted)+ .unwrap_or(first)+ } else {+ first+ }+ }};- let quality_height = Self::extract_quality_height(&selected.label);+ let quality_height =+ requested_height.or_else(|| Self::extract_quality_height(&selected.label));let video_url = &selected.url;ytdlp::download_video(@@ -181,3 +197,44 @@ impl PlatformDownloader for VimeoDownloader {.await}}++#[cfg(test)]+mod tests {+ use super::VimeoDownloader;+ use crate::models::media::VideoQuality;++ #[test]+ fn extract_quality_height_parses_4k_and_2k_and_best() {+ assert_eq!(VimeoDownloader::extract_quality_height("2160p"), Some(2160));+ assert_eq!(VimeoDownloader::extract_quality_height("1440p"), Some(1440));+ assert_eq!(VimeoDownloader::extract_quality_height("1080p"), Some(1080));+ assert_eq!(VimeoDownloader::extract_quality_height("best"), None);+ }++ #[test]+ fn upper_bound_selection_falls_back_to_max_available_when_video_is_1080p() {+ let qualities = vec![+ VideoQuality {+ label: "1080p".to_string(),+ width: 1920,+ height: 1080,+ url: "https://vimeo.com/1".to_string(),+ format: "ytdlp".to_string(),+ },+ VideoQuality {+ label: "720p".to_string(),+ width: 1280,+ height: 720,+ url: "https://vimeo.com/1".to_string(),+ format: "ytdlp".to_string(),+ },+ ];+ let requested_height = VimeoDownloader::extract_quality_height("2160p").unwrap();+ let selected = qualities+ .iter()+ .filter(|q| q.height > 0 && q.height <= requested_height)+ .max_by_key(|q| q.height)+ .unwrap();+ assert_eq!(selected.height, 1080);+ }+}diff --git a/src-tauri/src/core/queue.rs b/src-tauri/src/core/queue.rsindex 5e6396b1..b9bddd73 100644--- a/src-tauri/src/core/queue.rs+++ b/src-tauri/src/core/queue.rs@@ -1549,6 +1549,15 @@ async fn spawn_download_inner(final_output_dir = final_output_dir.join(&platform_name);}let torrent_id_slot = Arc::new(tokio::sync::Mutex::new(None));+ let raw_quality = quality.or_else(|| Some(settings.download.video_quality.clone()));+ let (effective_quality, download_mode) = if raw_quality.as_deref() == Some("audio") {+ (+ Some("best".to_string()),+ download_mode.or_else(|| Some("audio".to_string())),+ )+ } else {+ (raw_quality, download_mode)+ };let audio_format = if download_mode.as_deref() == Some("audio") {Some(settings.download.music_audio_format.clone())} else {@@ -1565,7 +1574,7 @@ async fn spawn_download_inner(args};let opts = crate::models::media::DownloadOptions {- quality: quality.or_else(|| Some(settings.download.video_quality.clone())),+ quality: effective_quality,output_dir: final_output_dir,filename_template: Some(tmpl),download_subtitles: settings.download.download_subtitles,diff --git a/src-tauri/src/platforms/twitch/mod.rs b/src-tauri/src/platforms/twitch/mod.rsindex fda6cfcf..0d6baa50 100644--- a/src-tauri/src/platforms/twitch/mod.rs+++ b/src-tauri/src/platforms/twitch/mod.rs@@ -297,6 +297,15 @@ impl PlatformDownloader for TwitchClipsDownloader {opts: &DownloadOptions,progress: mpsc::Sender<ProgressUpdate>,) -> anyhow::Result<DownloadResult> {+ let requested_height = opts.quality.as_deref().and_then(|s| {+ let trimmed = s.trim().to_lowercase();+ if trimmed == "best" || trimmed == "highest" {+ None+ } else {+ trimmed.trim_end_matches('p').parse::<u32>().ok()+ }+ });+if let Some(quality) = info.available_qualities.first() {if quality.format == "ytdlp" {let ytdlp_path = crate::core::ytdlp::ensure_ytdlp().await?;@@ -304,7 +313,7 @@ impl PlatformDownloader for TwitchClipsDownloader {&ytdlp_path,&quality.url,&opts.output_dir,- None,+ requested_height,progress,opts.download_mode.as_deref(),opts.format_id.as_deref(),@@ -326,13 +335,23 @@ impl PlatformDownloader for TwitchClipsDownloader {.first().ok_or_else(|| anyhow!("No media URL available"))?;- let selected = if let Some(ref wanted) = opts.quality {- info.available_qualities+ let selected = match requested_height {+ Some(h) => info+ .available_qualities.iter()- .find(|q| q.label == *wanted)- .unwrap_or(first)- } else {- first+ .filter(|q| q.height > 0 && q.height <= h)+ .max_by_key(|q| q.height)+ .unwrap_or(first),+ None => {+ if let Some(ref wanted) = opts.quality {+ info.available_qualities+ .iter()+ .find(|q| q.label == *wanted)+ .unwrap_or(first)+ } else {+ first+ }+ }};let filename = format!(diff --git a/src-tauri/src/platforms/vimeo/mod.rs b/src-tauri/src/platforms/vimeo/mod.rsindex dbe304a2..ab748877 100644--- a/src-tauri/src/platforms/vimeo/mod.rs+++ b/src-tauri/src/platforms/vimeo/mod.rs@@ -152,16 +152,32 @@ impl PlatformDownloader for VimeoDownloader {.first().ok_or_else(|| anyhow!("No quality available"))?;- let selected = if let Some(ref wanted) = opts.quality {- info.available_qualities+ let requested_height = opts+ .quality+ .as_deref()+ .and_then(Self::extract_quality_height);++ let selected = match requested_height {+ Some(h) => info+ .available_qualities.iter()- .find(|q| q.label == *wanted)- .unwrap_or(first)- } else {- first+ .filter(|q| q.height > 0 && q.height <= h)+ .max_by_key(|q| q.height)+ .unwrap_or(first),+ None => {+ if let Some(ref wanted) = opts.quality {+ info.available_qualities+ .iter()+ .find(|q| q.label == *wanted)+ .unwrap_or(first)+ } else {+ first+ }+ }};- let quality_height = Self::extract_quality_height(&selected.label);+ let quality_height =+ requested_height.or_else(|| Self::extract_quality_height(&selected.label));let video_url = &selected.url;ytdlp::download_video(diff --git a/src/components/download/GlobalDownloadBar.svelte b/src/components/download/GlobalDownloadBar.svelteindex 123c28b3..bfb8fe2b 100644--- a/src/components/download/GlobalDownloadBar.svelte+++ b/src/components/download/GlobalDownloadBar.svelte@@ -7,7 +7,7 @@getSpeedHistory,type DownloadItem,} from "$lib/stores/download-store.svelte";- import { formatBytes, formatSpeed } from "$lib/download-format";+ import { formatBytes, formatSpeed, formatEta } from "$lib/download-format";const downloadsMap = $derived(getDownloads());@@ -65,6 +65,15 @@return `${formatBytes(downloaded)}`;});+ const primaryEta = $derived.by(() => {+ for (const item of activeItems) {+ if (item.kind === "generic" && item.etaSeconds && item.etaSeconds > 0) {+ return formatEta(item.etaSeconds);+ }+ }+ return "";+ });+const sparklinePaths = $derived.by(() => {const primary = activeItems[0];if (!primary) return { line: "", area: "" };@@ -117,25 +126,30 @@<span class="dock-sep">·</span><span>{bytesSummary}</span><span class="dock-speed">{formatSpeed(totalSpeed)}</span>+ {#if primaryEta}+ <span class="dock-eta">{$t('downloads.eta_left', { eta: primaryEta })}</span>+ {/if}</span>- <svg- class="dock-sparkline"- viewBox="0 0 64 18"- width="64"- height="18"- aria-hidden="true"- >- <path class="dock-sparkline-area" d={sparklinePaths.area} />- <path class="dock-sparkline-line" d={sparklinePaths.line} />- </svg>+ <span class="dock-sparkline-box" aria-hidden="true">+ <svg+ class="dock-sparkline"+ viewBox="0 0 64 18"+ width="64"+ height="18"+ aria-hidden="true"+ >+ <path class="dock-sparkline-area" d={sparklinePaths.area} />+ <path class="dock-sparkline-line" d={sparklinePaths.line} />+ </svg>+ </span><buttontype="button"class="dock-view-btn"onclick={() => goto("/downloads")}>- {$t('downloads.view_queue')}+ {$t('downloads.view_downloads')}</button></div></div>@@ -230,6 +244,23 @@color: var(--text-dim);}+ .dock-eta {+ margin-left: var(--space-1);+ color: var(--text-dim);+ }++ .dock-sparkline-box {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ height: 24px;+ padding: 0 6px;+ border-radius: var(--radius-xs);+ background: var(--fill-1);+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);+ flex-shrink: 0;+ }+.dock-sparkline {flex-shrink: 0;overflow: visible;diff --git a/src/components/omnibox/DownloadModeSelector.svelte b/src/components/omnibox/DownloadModeSelector.svelteindex b8fcb6e9..08fb3a45 100644--- a/src/components/omnibox/DownloadModeSelector.svelte+++ b/src/components/omnibox/DownloadModeSelector.svelte@@ -11,7 +11,8 @@onclick={() => { downloadMode = "auto"; onChange?.(); }}><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <path d="M12 3l1.912 5.813a2 2 0 001.272 1.272L21 12l-5.813 1.912a2 2 0 00-1.272 1.272L12 21l-1.912-5.813a2 2 0 00-1.272-1.272L3 12l5.813-1.912a2 2 0 001.272-1.272z" />+ <rect x="2" y="6" width="14" height="12" rx="2" />+ <path d="m22 8-6 4 6 4V8Z" /></svg>{$t('omnibox.mode_auto')}</button>diff --git a/src/components/omnibox/MediaPreview.svelte b/src/components/omnibox/MediaPreview.svelteindex d50794e1..46ea9e51 100644--- a/src/components/omnibox/MediaPreview.svelte+++ b/src/components/omnibox/MediaPreview.svelte@@ -34,17 +34,15 @@<img class="preview-art" src="/emoji/package.png" alt="" width="32" height="32" draggable="false" /></div>{/if}- {#if mediaPreview.duration_seconds}- <span class="preview-duration-badge">- {formatDuration(mediaPreview.duration_seconds)}- </span>- {/if}</div><div class="preview-info"><p class="preview-title">{mediaPreview.title}</p>{#if mediaPreview.author}<p class="preview-author">{mediaPreview.author}</p>{/if}+ {#if mediaPreview.duration_seconds}+ <p class="preview-duration">{formatDuration(mediaPreview.duration_seconds)}</p>+ {/if}</div></div>{/if}@@ -52,21 +50,25 @@<style>.preview-container {display: flex;- gap: calc(var(--padding) * 1.5);- align-items: flex-start;- padding: 0 calc(var(--padding) * 1.5);- max-width: 400px;+ gap: var(--space-3);+ align-items: center;+ padding: 0;+ width: 100%;}.preview-thumbnail-wrapper {position: relative;flex-shrink: 0;+ width: 128px;+ height: 72px;+ border-radius: var(--radius-sm);+ overflow: hidden;}.preview-skeleton {- width: 120px;- height: 67.5px;- border-radius: calc(var(--border-radius) - 4px);+ width: 128px;+ height: 72px;+ border-radius: var(--radius-sm);background: var(--button-elevated);animation: skeleton-shimmer 2s infinite;}@@ -75,9 +77,9 @@display: flex;align-items: center;justify-content: center;- width: 120px;- height: 67.5px;- border-radius: calc(var(--border-radius) - 4px);+ width: 128px;+ height: 72px;+ border-radius: var(--radius-sm);background: var(--button-elevated);}@@ -91,9 +93,9 @@}.preview-thumbnail {- width: 120px;- height: 67.5px;- border-radius: calc(var(--border-radius) - 4px);+ width: 128px;+ height: 72px;+ border-radius: var(--radius-sm);object-fit: cover;opacity: 0;transition: opacity 0.2s;@@ -106,49 +108,41 @@.preview-info {display: flex;flex-direction: column;- gap: 4px;+ gap: 3px;flex: 1;min-width: 0;- padding-top: 4px;}.preview-title {margin: 0;- font-size: 13px;- font-weight: 500;- color: var(--secondary);+ font-size: var(--text-base);+ font-weight: 600;+ color: var(--text);overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;line-clamp: 2;- line-height: 1.4;+ line-height: 1.35;}.preview-author {margin: 0;- font-size: var(--text-xs);+ font-size: var(--text-sm);font-weight: 500;- color: var(--gray);+ color: var(--text-muted);overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}- .preview-duration-badge {- position: absolute;- bottom: 4px;- right: 4px;- padding: 1px 5px;+ .preview-duration {+ margin: 0;font-size: var(--text-xs);font-weight: 500;- line-height: 1.3;- color: #fff;- background: rgba(0, 0, 0, 0.75);- border-radius: var(--radius-xs);+ color: var(--text-dim);font-variant-numeric: tabular-nums;- pointer-events: none;}@media (max-width: 535px) {diff --git a/src/components/omnibox/QualityPicker.svelte b/src/components/omnibox/QualityPicker.svelteindex 320c2b1f..a54c7692 100644--- a/src/components/omnibox/QualityPicker.svelte+++ b/src/components/omnibox/QualityPicker.svelte@@ -19,16 +19,12 @@{ value: "360p", key: "omnibox.quality_360p", height: 360 },];- // Derive which resolution pills to show.- // Before formats load: show standard set (Best + 1080p + 720p + 480p + 360p).- // After formats load: show only resolutions actually available, plus Best always.let visibleOptions = $derived.by(() => {if (!availableHeights) {- // Pre-fetch fallback: strip 2K / 4K from hardcoded list to keep UI tidy- return RESOLUTION_OPTIONS.filter(o => o.height === Infinity || o.height <= 1080);+ return RESOLUTION_OPTIONS;}return RESOLUTION_OPTIONS.filter(o => {- if (o.height === Infinity) return true; // "Best" always shown+ if (o.height === Infinity || o.value === selectedQuality) return true;return availableHeights!.some(h => h === o.height);});});diff --git a/src/components/omnibox/quality-and-mode.test.ts b/src/components/omnibox/quality-and-mode.test.tsnew file mode 100644index 00000000..d9d1e39a--- /dev/null+++ b/src/components/omnibox/quality-and-mode.test.ts@@ -0,0 +1,59 @@+import fs from "node:fs";+import path from "node:path";+import { describe, expect, it } from "vitest";++const repoRoot = path.resolve(__dirname, "../../..");++describe("Home v1-hero UI and 4K/2K Quality & Mode wiring", () => {+ it("passes {selectedFormatId} (not bare boolean) to QualityPicker and hides it in audio mode", () => {+ const homePage = fs.readFileSync(+ path.join(repoRoot, "src/routes/+page.svelte"),+ "utf8",+ );+ expect(homePage).toContain(+ "<QualityPicker bind:selectedQuality {selectedFormatId} {availableHeights} {hasAudioOnly} />",+ );+ expect(homePage).not.toContain("selectedFormatId {availableHeights}");+ expect(homePage).toContain('{#if downloadMode !== "audio"}');+ });++ it("exposes 4K (2160p) and 2K (1440p) in both QualityPicker and Settings QualitySection", () => {+ const qualityPicker = fs.readFileSync(+ path.join(repoRoot, "src/components/omnibox/QualityPicker.svelte"),+ "utf8",+ );+ expect(qualityPicker).toContain('{ value: "2160p", key: "omnibox.quality_2160p", height: 2160 }');+ expect(qualityPicker).toContain('{ value: "1440p", key: "omnibox.quality_1440p", height: 1440 }');+ expect(qualityPicker).not.toContain("o.height <= 1080");++ const qualitySection = fs.readFileSync(+ path.join(repoRoot, "src/components/settings/downloads/QualitySection.svelte"),+ "utf8",+ );+ expect(qualitySection).toContain('<option value="2160p">{$t(\'omnibox.quality_2160p\')}</option>');+ expect(qualitySection).toContain('<option value="1440p">{$t(\'omnibox.quality_1440p\')}</option>');+ });++ it("uses Video mode label and Quality and more toggle label in en.json", () => {+ const en = JSON.parse(+ fs.readFileSync(path.join(repoRoot, "src/lib/i18n/en.json"), "utf8"),+ );+ expect(en.omnibox.mode_auto).toBe("Video");+ expect(en.omnibox.options).toBe("Quality and more");+ expect(en.omnibox.detecting).toBe("Checking link...");+ expect(en.omnibox.added_to_downloads).toBe("Added to Downloads");+ expect(en.omnibox.open_downloads).toBe("Open Downloads");+ expect(en.downloads.view_downloads).toBe("View downloads");+ });++ it("renders 3-line MediaPreview info (title, author, duration) without thumbnail overlay badge", () => {+ const mediaPreview = fs.readFileSync(+ path.join(repoRoot, "src/components/omnibox/MediaPreview.svelte"),+ "utf8",+ );+ expect(mediaPreview).toContain('class="preview-title"');+ expect(mediaPreview).toContain('class="preview-author"');+ expect(mediaPreview).toContain('class="preview-duration"');+ expect(mediaPreview).not.toContain("preview-duration-badge");+ });+});diff --git a/src/components/settings/downloads/QualitySection.svelte b/src/components/settings/downloads/QualitySection.svelteindex 7db1fc55..33ff4049 100644--- a/src/components/settings/downloads/QualitySection.svelte+++ b/src/components/settings/downloads/QualitySection.svelte@@ -55,6 +55,8 @@</div><select class="select" value={settings.download.video_quality} onchange={changeQuality}><option value="best">{$t('omnibox.quality_best')}</option>+ <option value="2160p">{$t('omnibox.quality_2160p')}</option>+ <option value="1440p">{$t('omnibox.quality_1440p')}</option><option value="1080p">{$t('omnibox.quality_1080p')}</option><option value="720p">{$t('omnibox.quality_720p')}</option><option value="480p">{$t('omnibox.quality_480p')}</option>diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.jsonindex a3f1e093..f1b55f11 100644--- a/src/lib/i18n/el.json+++ b/src/lib/i18n/el.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Πήγαινε σε Hotmart","go_to_udemy": "Πήγαινε σε Udemy","download": "Λήψη",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "Επιλογές","advanced": "Προχωρημένα","preparing": "Προετοιμασία μεταφόρτωσης...",diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.jsonindex 2c156a5e..b122bd1c 100644--- a/src/lib/i18n/en.json+++ b/src/lib/i18n/en.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,7 +4258,10 @@"go_to_hotmart": "Go to Hotmart","go_to_udemy": "Go to Udemy","download": "Download",- "options": "Options",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads",+ "options": "Quality and more","advanced": "Advanced","preparing": "Preparing download...","error": "Download failed",@@ -4271,7 +4276,7 @@"batch_file_open": "Load from file","batch_file_title": "Select a .txt file with URLs","batch_file_empty": "No valid URLs found in the file",- "mode_auto": "Auto",+ "mode_auto": "Video","mode_audio": "Audio Only (MP3)","mode_mute": "No Sound","quality": "Quality",diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.jsonindex ec3355d7..1053a2f7 100644--- a/src/lib/i18n/es.json+++ b/src/lib/i18n/es.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Ir a Hotmart","go_to_udemy": "Ir a Udemy","download": "Descargar",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "Opciones","advanced": "Avanzado","preparing": "Preparando descarga...",diff --git a/src/lib/i18n/fa.json b/src/lib/i18n/fa.jsonindex bc8e59d7..564dfe2c 100644--- a/src/lib/i18n/fa.json+++ b/src/lib/i18n/fa.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Go to Hotmart","go_to_udemy": "Go to Udemy","download": "Download",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "Options","advanced": "Advanced","preparing": "Preparing download...",diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.jsonindex 34821cb3..1f66d1f8 100644--- a/src/lib/i18n/fr.json+++ b/src/lib/i18n/fr.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Aller sur Hotmart","go_to_udemy": "Aller sur Udemy","download": "Télécharger",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "Options","advanced": "Avancé","preparing": "Préparation du téléchargement...",diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.jsonindex 8232ca81..1382ed48 100644--- a/src/lib/i18n/it.json+++ b/src/lib/i18n/it.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Vai a Hotmart","go_to_udemy": "Vai a Udemy","download": "Scarica",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "Opzioni","advanced": "Avanzato","preparing": "Preparazione download...",diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.jsonindex 600f3ce3..3afe3788 100644--- a/src/lib/i18n/ja.json+++ b/src/lib/i18n/ja.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Hotmartへ移動","go_to_udemy": "Udemyへ移動","download": "ダウンロード",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "オプション","advanced": "詳細","preparing": "ダウンロードを準備中...",diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.tsindex 03b04644..4ed06e03 100644--- a/src/lib/i18n/keys.ts+++ b/src/lib/i18n/keys.ts@@ -229,6 +229,7 @@ export type TranslationKeys =| 'downloads.empty_cta'| 'downloads.empty_hint'| 'downloads.error_details'+ | 'downloads.eta_left'| 'downloads.filter.active'| 'downloads.filter.all'| 'downloads.filter.completed'@@ -333,6 +334,7 @@ export type TranslationKeys =| 'downloads.sw.translated'| 'downloads.sw.twopoint'| 'downloads.title'+ | 'downloads.view_downloads'| 'downloads.view_history'| 'downloads.view_queue'| 'downloads.view_tools'@@ -681,6 +683,7 @@ export type TranslationKeys =| 'notifications.title'| 'notifications.unread_indicator'+ | 'omnibox.added_to_downloads'| 'omnibox.adv.args_hint'| 'omnibox.adv.args_label'| 'omnibox.adv.args_placeholder'@@ -725,6 +728,7 @@ export type TranslationKeys =| 'omnibox.cookie_hint_stale'| 'omnibox.courses_plugin_needed'| 'omnibox.courses_plugin_ready'+ | 'omnibox.detecting'| 'omnibox.download'| 'omnibox.error'| 'omnibox.external_url_ready'@@ -750,6 +754,7 @@ export type TranslationKeys =| 'omnibox.mode_mute'| 'omnibox.mode_normal'| 'omnibox.no_formats'+ | 'omnibox.open_downloads'| 'omnibox.options'| 'omnibox.placeholder'| 'omnibox.playlist_all'diff --git a/src/lib/i18n/lo.json b/src/lib/i18n/lo.jsonindex 86597f2d..eb47e284 100644--- a/src/lib/i18n/lo.json+++ b/src/lib/i18n/lo.json@@ -3245,6 +3245,8 @@"speed_unlimited": "ບໍ່ຈຳກັດຄວາມໄວ","error_details": "ລາຍລະອຽດທາງເທັກນິກ","view_queue": "ການດາວໂຫຼດ",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "ປະຫວັດ","view_tools": "ເຄື່ອງມື"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "ໄປທີ່ Hotmart","go_to_udemy": "ໄປທີ່ Udemy","download": "ດາວໂຫຼດ",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "ຕົວເລືອກ","advanced": "ຂັ້ນສູງ","preparing": "ກຳລັງກຽມດາວໂຫຼດ...",diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.jsonindex fb5fe7a9..baff0923 100644--- a/src/lib/i18n/pt.json+++ b/src/lib/i18n/pt.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "Histórico","view_tools": "Ferramentas"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Ir para Hotmart","go_to_udemy": "Ir para Udemy","download": "Baixar",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "Opções","advanced": "Avançado","preparing": "Preparando download...",diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.jsonindex e4b3341e..dd5e73e0 100644--- a/src/lib/i18n/ru.json+++ b/src/lib/i18n/ru.json@@ -3245,6 +3245,8 @@"speed_unlimited": "Без ограничения скорости","error_details": "Технические детали","view_queue": "Загрузки",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "История","view_tools": "Инструменты"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "Перейти в Hotmart","go_to_udemy": "Перейти в Udemy","download": "Скачать",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "Опции","advanced": "Дополнительно","preparing": "Подготовка к скачиванию…",diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.jsonindex 844c59f5..387f6a8b 100644--- a/src/lib/i18n/zh-TW.json+++ b/src/lib/i18n/zh-TW.json@@ -3245,6 +3245,8 @@"speed_unlimited": "No speed limit","error_details": "Technical details","view_queue": "Downloads",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "History","view_tools": "Tools"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "前往 Hotmart","go_to_udemy": "前往 Udemy","download": "下載",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "选项","advanced": "高级","preparing": "正在準備下載...",diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.jsonindex 7c824514..209ea6d1 100644--- a/src/lib/i18n/zh.json+++ b/src/lib/i18n/zh.json@@ -3245,6 +3245,8 @@"speed_unlimited": "不限速","error_details": "技术详情","view_queue": "下载",+ "view_downloads": "View downloads",+ "eta_left": "About {{eta}} left","view_history": "历史记录","view_tools": "工具"},@@ -4256,6 +4258,9 @@"go_to_hotmart": "前往 Hotmart","go_to_udemy": "前往 Udemy","download": "下载",+ "detecting": "Checking link...",+ "added_to_downloads": "Added to Downloads",+ "open_downloads": "Open Downloads","options": "选项","advanced": "高级","preparing": "正在准备下载...",diff --git a/src/lib/style/macos-shell.css b/src/lib/style/macos-shell.cssindex 48a99608..e6debbf7 100644--- a/src/lib/style/macos-shell.css+++ b/src/lib/style/macos-shell.css@@ -953,13 +953,35 @@display: flex;flex-direction: column;align-items: center;- justify-content: center;- gap: var(--space-5);+ justify-content: flex-start;+ gap: var(--space-4);position: relative;padding: var(--space-6) var(--space-5) var(--space-8);+ overflow-y: auto;isolation: isolate;}+.home-stage-inner {+ margin: auto 0;+ width: 100%;+ max-width: 560px;+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: var(--space-4);+}++.home-stage-hero {+ display: flex;+ justify-content: center;+ transition: filter var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);+}++.home-stage-hero--detecting {+ filter: blur(6px);+ opacity: 0.78;+}+/* one warm light behind the mascot — the single decorative moment of the page */.home-stage::before {content: "";@@ -1080,9 +1102,10 @@flex-shrink: 0;width: 100%;min-width: 0;- max-width: 640px;+ max-width: 560px;display: flex;flex-direction: column;+ align-items: center;gap: var(--space-3);}diff --git a/src/routes/+page.svelte b/src/routes/+page.svelteindex 7b08eb2f..e1c0d168 100644--- a/src/routes/+page.svelte+++ b/src/routes/+page.svelte@@ -192,6 +192,8 @@let lastCompletionAt = $state(0);let firstCompletionOfSession = $state(false);let completionSeenIds = new Set<string | number>();+ let addedNoticeActive = $state(false);+ let addedNoticeTimer: ReturnType<typeof setTimeout> | null = null;$effect(() => {for (const [id, item] of downloads.entries()) {@@ -242,6 +244,10 @@let mascotEmotion = $derived.by((): "idle" | "downloading" | "error" | "stalled" | "queue" | "complete" | "amazed" => {void stallTick;+ if (addedNoticeActive) {+ return "complete";+ }+if (lastCompletionAt > 0 && Date.now() - lastCompletionAt < 5000) {return firstCompletionOfSession && completionSeenIds.size === 1 ? "amazed" : "complete";}@@ -269,8 +275,8 @@return "idle";});- let mascotCompact = $derived(omniState.kind !== "idle");- let isStage = $derived(omniState.kind === "idle" && !advancedMode);+ let mascotCompact = $derived(advancedMode);+ let isStage = $derived(!advancedMode);function pickRandom(raw: string): string {if (raw.includes("|")) {@@ -369,6 +375,11 @@function handleInput() {if (debounceTimer) clearTimeout(debounceTimer);+ if (addedNoticeTimer) {+ clearTimeout(addedNoticeTimer);+ addedNoticeTimer = null;+ }+ addedNoticeActive = false;clearMediaPreview();clipStart = "";clipEnd = "";@@ -385,10 +396,15 @@const saved = currentSettings?.last_download_options;const savedMode = saved?.mode;const settingsQuality = currentSettings?.download.video_quality;- selectedQuality = settingsQuality && typeof settingsQuality === "string"- ? settingsQuality- : "best";- downloadMode = savedMode === "audio" || savedMode === "mute" ? savedMode : "auto";+ if (settingsQuality === "audio") {+ selectedQuality = "best";+ downloadMode = "audio";+ } else {+ selectedQuality = settingsQuality && typeof settingsQuality === "string"+ ? settingsQuality+ : "best";+ downloadMode = savedMode === "audio" || savedMode === "mute" ? savedMode : "auto";+ }selectedFormatId = null;formats = [];loadingFormats = false;@@ -420,7 +436,7 @@}debounceTimer = setTimeout(() => {detectPlatform(targetUrl);- }, 500);+ }, 120);return;}@@ -437,15 +453,8 @@async function detectPlatform(value: string) {try {const result = await invoke<PlatformInfo>("detect_platform", { url: value });+ if (url.trim() !== value) return;if (result.supported) {- omniState = { kind: "detected", info: result };- if (!COURSE_PLATFORMS.has(result.platform)) {- setTimeout(() => {- if (url === value) {- invoke("prefetch_media_info", { url: value }).catch(() => {});- }- }, 400);- }loadCookieAccounts(value);if (result.content_type === "playlist") {loadPlaylistEntries(value);@@ -453,11 +462,31 @@if (isTorrentUrl(value)) {loadTorrentContents(value);}+ const shouldPrefetch =+ !COURSE_PLATFORMS.has(result.platform) &&+ result.platform !== "direct_file" &&+ result.platform !== "p2p" &&+ !isTorrentUrl(value);+ if (shouldPrefetch) {+ invoke("prefetch_media_info", { url: value }).catch(() => {});+ const startedAt = Date.now();+ while (+ url.trim() === value &&+ getMediaPreview()?.url !== value &&+ Date.now() - startedAt < 2200+ ) {+ await new Promise((r) => setTimeout(r, 50));+ }+ }+ if (url.trim() !== value) return;+ omniState = { kind: "detected", info: result };} else {omniState = { kind: "unsupported" };}} catch {- omniState = { kind: "unsupported" };+ if (url.trim() === value) {+ omniState = { kind: "unsupported" };+ }}}@@ -768,7 +797,13 @@stopAt: toEpochMs(scheduleStop),});persistLastDownloadOptions();+ clearMediaPreview();omniState = { kind: "idle" };+ addedNoticeActive = true;+ if (addedNoticeTimer) clearTimeout(addedNoticeTimer);+ addedNoticeTimer = setTimeout(() => {+ addedNoticeActive = false;+ }, 3000);} catch (e: any) {const msg = typeof e === "string" ? e : e.message ?? $t("omnibox.error");omniState = {@@ -964,304 +999,295 @@</script><div class="home-mac" class:home-mac--stage={isStage}>--- {#if isStage}- <div class="home-stage">- <HomeHero emotion={mascotEmotion} stage celebrate={mascotEmotion === "amazed"} />- <h1 class="home-stage-title">{$t('home.hero_title')}</h1>- <HomeUrlBar- variant="stage"- bind:url- bind:mode={homeInputMode}- onInput={handleInput}- onModeChange={handleHomeModeChange}- onAdvanced={() => { advancedMode = true; }}- />- <p class="home-value">- {#if dlStats.totalDownloads > 0}- {@html $t('home.value_line', { count: `<strong>${dlStats.totalDownloads.toLocaleString()}</strong>`, size: `<strong>${formatBytes(dlStats.totalBytes)}</strong>` })}- {:else}- {$t('home.value_first')}- {/if}- </p>- </div>- {:else}- <div class="home-mac-workspace" class:home-mac-workspace--idle={omniState.kind === "idle"}>- <div class="home-mac-hero">- <HomeHero- emotion={mascotEmotion}- compact={mascotCompact}- bubbleText={bubbleText || undefined}- celebrate={mascotEmotion === "amazed"}- />- </div>- <div class="home-mac-main">- {#if advancedMode}+ {#if advancedMode}+ <div class="home-mac-workspace">+ <div class="home-mac-hero">+ <HomeHero+ emotion={mascotEmotion}+ compact={mascotCompact}+ celebrate={mascotEmotion === "amazed"}+ />+ </div>+ <div class="home-mac-main"><div class="home-secondary home-secondary--start"><button type="button" class="home-secondary-link" onclick={() => { advancedMode = false; }}>{$t('home.action_simple')}</button></div><OmniboxAdvanced />- {:else}- {#if externalNotice}- <div class="feedback-card feedback-enter external-url-card">- <div class="card-row">- <svg class="card-status-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <path d="M12 5v14" />- <path d="M5 12h14" />- </svg>- <span class="card-title">{$t('omnibox.external_url_ready')}</span>- <button class="dismiss-btn" onclick={() => { externalNotice = null; }} aria-label={$t('common.close')}>- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <path d="M18 6L6 18M6 6l12 12" />- </svg>- </button>- </div>- <div class="card-row">- <span class="card-subtext external-url-text">{externalNotice.url}</span>- </div></div>- {/if}-+ </div>+ {:else}+ <div class="home-stage">+ <div class="home-stage-inner">+ <div class="home-stage-hero" class:home-stage-hero--detecting={omniState.kind === "detecting"}>+ <HomeHero+ emotion={mascotEmotion}+ stage+ celebrate={mascotEmotion === "amazed" || addedNoticeActive}+ />+ </div>- {#if omniState.kind === "detecting"}- <div class="feedback feedback-enter">- <span class="feedback-spinner"></span>- </div>+ <div class="home-mac-main">+ {#if externalNotice}+ <div class="feedback-card feedback-enter external-url-card">+ <div class="card-row">+ <svg class="card-status-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M12 5v14" />+ <path d="M5 12h14" />+ </svg>+ <span class="card-title">{$t('omnibox.external_url_ready')}</span>+ <button class="dismiss-btn" onclick={() => { externalNotice = null; }} aria-label={$t('common.close')}>+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M18 6L6 18M6 6l12 12" />+ </svg>+ </button>+ </div>+ <div class="card-row">+ <span class="card-subtext external-url-text">{externalNotice.url}</span>+ </div>+ </div>+ {/if}- {:else if omniState.kind === "detected"}- <div class="feedback feedback-enter" data-supported="true">- <span class="feedback-text">- {platformDisplayName(omniState.info.platform)}- {#if omniState.info.content_type}- <span class="feedback-sep">·</span>- {getContentTypeLabel(omniState.info.content_type)}+ {#if showOmnibox}+ <HomeUrlBar+ variant="stage"+ bind:url+ bind:mode={homeInputMode}+ onInput={handleInput}+ onModeChange={handleHomeModeChange}+ onAdvanced={() => { advancedMode = true; }}+ />{/if}- </span>- </div>- {/if}-- {#if showOmnibox}- <HomeUrlBar- bind:url- bind:mode={homeInputMode}- onInput={handleInput}- onModeChange={handleHomeModeChange}- onAdvanced={() => { advancedMode = true; }}- />- {/if}-- {#if omniState.kind === "batch"}- <div class="batch-options">- <DownloadModeSelector bind:downloadMode />- <BatchDownload count={omniState.urls.length} onDownload={handleBatchDownload} />- </div>- {:else if omniState.kind === "searching"}- <div class="feedback feedback-enter">- <span class="feedback-spinner"></span>- <span class="feedback-text search-hint">{$t('omnibox.searching')}</span>- </div>+ {#if omniState.kind === "detecting"}+ <div class="feedback feedback-enter">+ <span class="feedback-text">{$t('omnibox.detecting')}</span>+ </div>- {:else if omniState.kind === "search-results"}- <SearchResults results={omniState.results} onSelect={selectSearchResult} />+ {:else if omniState.kind === "detected"}+ <div class="feedback feedback-enter" data-supported="true">+ <span class="feedback-text">{platformDisplayName(omniState.info.platform)}</span>+ </div>- {:else if omniState.kind === "search-empty"}- <div class="feedback feedback-enter" data-supported="false">- <svg class="feedback-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <circle cx="11" cy="11" r="8" />- <path d="M21 21l-4.35-4.35" />- </svg>- <span class="feedback-text">{$t('omnibox.search_empty')}</span>- </div>+ {:else if omniState.kind === "idle" && addedNoticeActive}+ <div class="feedback feedback-enter added-notice">+ <strong class="added-notice-title">{$t('omnibox.added_to_downloads')}</strong>+ <button type="button" class="added-notice-link" onclick={() => goto("/downloads")}>+ {$t('omnibox.open_downloads')}+ </button>+ </div>- {:else if omniState.kind === "unsupported"}- <div class="feedback feedback-enter" data-supported="false">- <svg class="feedback-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <circle cx="12" cy="12" r="10" />- <path d="M12 8v4m0 4h.01" />- </svg>- <span class="feedback-text">{$t('omnibox.unsupported')}</span>- </div>- {/if}- {/if}-- <HomeInspector open={showInspector} title={$t('home.inspector_title')}>- {#if omniState.kind === "detected"}- <MediaPreview bind:mediaPreview bind:imageLoading={previewImageLoading} />- {#if omniState.info.content_type === "playlist"}- <div class="playlist-picker">- <div class="playlist-head">- <span class="playlist-count">- {$t('omnibox.playlist_selected', { selected: selectedPlaylistItems.size, total: playlistEntries.length })}- </span>- {#if !playlistLoading && playlistEntries.length > 0}- <div class="playlist-bulk">- <button type="button" class="playlist-link" onclick={selectAllPlaylist}>{$t('omnibox.playlist_all')}</button>- <button type="button" class="playlist-link" onclick={selectNonePlaylist}>{$t('omnibox.playlist_none')}</button>- </div>- {/if}+ {:else if omniState.kind === "batch"}+ <div class="batch-options">+ <DownloadModeSelector bind:downloadMode />+ <BatchDownload count={omniState.urls.length} onDownload={handleBatchDownload} /></div>- {#if playlistLoading}- <div class="playlist-status"><span class="feedback-spinner"></span> {$t('omnibox.playlist_loading')}</div>- {:else if playlistEntries.length === 0}- <span class="playlist-status">{$t('omnibox.playlist_empty')}</span>- {:else}- <ul class="playlist-list">- {#each playlistEntries as entry (entry.index)}- <li>- <label class="playlist-item">- <input type="checkbox" checked={selectedPlaylistItems.has(entry.index)} onchange={() => togglePlaylistItem(entry.index)} />- <span class="playlist-idx">{entry.index}.</span>- <span class="playlist-title">{entry.title}</span>- </label>- </li>- {/each}- </ul>- {/if}- </div>- {/if}- {#if torrentLoading || torrentEntries.length > 0}- <div class="playlist-picker">- <div class="playlist-head">- <span class="playlist-count">- {$t('omnibox.torrent_selected', { selected: selectedTorrentFiles.size, total: torrentEntries.length })}- </span>- {#if !torrentLoading && torrentEntries.length > 0}- <div class="playlist-bulk">- <button type="button" class="playlist-link" onclick={selectAllTorrent}>{$t('omnibox.playlist_all')}</button>- <button type="button" class="playlist-link" onclick={selectNoneTorrent}>{$t('omnibox.playlist_none')}</button>- </div>- {/if}++ {:else if omniState.kind === "searching"}+ <div class="feedback feedback-enter">+ <span class="feedback-spinner"></span>+ <span class="feedback-text search-hint">{$t('omnibox.searching')}</span>+ </div>++ {:else if omniState.kind === "search-results"}+ <SearchResults results={omniState.results} onSelect={selectSearchResult} />++ {:else if omniState.kind === "search-empty"}+ <div class="feedback feedback-enter" data-supported="false">+ <svg class="feedback-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <circle cx="11" cy="11" r="8" />+ <path d="M21 21l-4.35-4.35" />+ </svg>+ <span class="feedback-text">{$t('omnibox.search_empty')}</span>+ </div>++ {:else if omniState.kind === "unsupported"}+ <div class="feedback feedback-enter" data-supported="false">+ <svg class="feedback-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <circle cx="12" cy="12" r="10" />+ <path d="M12 8v4m0 4h.01" />+ </svg>+ <span class="feedback-text">{$t('omnibox.unsupported')}</span></div>- {#if torrentLoading}- <div class="playlist-status"><span class="feedback-spinner"></span> {$t('omnibox.torrent_loading')}</div>- {:else}- <ul class="playlist-list">- {#each torrentEntries as entry (entry.index)}- <li>- <label class="playlist-item">- <input type="checkbox" checked={selectedTorrentFiles.has(entry.index)} onchange={() => toggleTorrentFile(entry.index)} />- <span class="playlist-title">{entry.path}</span>- <span class="torrent-size">{formatBytes(entry.size_bytes)}</span>- </label>- </li>- {/each}- </ul>- {/if}- </div>- {/if}- {#if cookieHint}- <p class="cookie-hint" class:expired={cookieHint === "expired"} role="status">- <span>{cookieHint === "expired" ? $t("omnibox.cookie_hint_expired") : $t("omnibox.cookie_hint_stale")}</span>- <button type="button" class="cookie-hint-link" onclick={() => goto("/settings?tab=cookies")}>{$t("omnibox.cookie_hint_action")}</button>- </p>- {/if}- {#if COURSE_PLATFORMS.has(omniState.info.platform)}- {#if coursesPluginInstalled === false}- <p class="course-upsell">{$t('omnibox.courses_plugin_needed')}</p>- <button class="download-primary-btn" onclick={() => goto("/marketplace")}>{$t('omnibox.install_courses_plugin')}</button>- {:else}- <p class="course-upsell">{$t('omnibox.courses_plugin_ready')}</p>- <button class="download-primary-btn" onclick={handleAction}>{$t(omniState.info.platform === "udemy" ? 'omnibox.go_to_udemy' : 'omnibox.go_to_hotmart')}</button>- {/if}- {:else}- {@const playlistBlocked = omniState.info.content_type === "playlist" && playlistEntries.length > 0 && selectedPlaylistItems.size === 0}- {@const torrentBlocked = torrentEntries.length > 0 && selectedTorrentFiles.size === 0}- {#if omniState.info.platform === "bilibili"}- <BilibiliPreviewExtras {url} accountSlug={selectedCookieSlug && selectedCookieSlug !== "_anonymous" ? selectedCookieSlug : null} />{/if}- <button class="download-primary-btn" disabled={playlistBlocked || torrentBlocked} onclick={handleAction}>{$t('omnibox.download')}</button>- {#if omniState.info.platform !== "direct_file"}- <details class="options-panel">- <summary class="options-toggle">{$t('omnibox.options')}</summary>- <div class="options-content">- <DownloadModeSelector bind:downloadMode onChange={() => { selectedFormatId = null; }} />- <QualityPicker bind:selectedQuality selectedFormatId {availableHeights} {hasAudioOnly} />- {#if cookieAccounts.length > 1}- <CookieAccountPicker accounts={cookieAccounts} bind:selectedSlug={selectedCookieSlug} />- {/if}- <details class="options-panel">- <summary class="options-toggle">{$t('omnibox.advanced')}</summary>- <div class="options-content">- {#if omniState.info.platform === "vimeo" || omniState.info.platform === "generic"}- <div class="referer-input-wrapper">- <label class="referer-label" for="referer-input">{$t('omnibox.referer_label')}</label>- <input id="referer-input" class="referer-input" type="text" placeholder={$t('omnibox.referer_placeholder')} bind:value={referer} spellcheck="false" />++ <HomeInspector open={showInspector} title={$t('home.inspector_title')}>+ {#if omniState.kind === "detected"}+ <MediaPreview bind:mediaPreview bind:imageLoading={previewImageLoading} />+ {#if omniState.info.content_type === "playlist"}+ <div class="playlist-picker">+ <div class="playlist-head">+ <span class="playlist-count">+ {$t('omnibox.playlist_selected', { selected: selectedPlaylistItems.size, total: playlistEntries.length })}+ </span>+ {#if !playlistLoading && playlistEntries.length > 0}+ <div class="playlist-bulk">+ <button type="button" class="playlist-link" onclick={selectAllPlaylist}>{$t('omnibox.playlist_all')}</button>+ <button type="button" class="playlist-link" onclick={selectNonePlaylist}>{$t('omnibox.playlist_none')}</button></div>{/if}- {#if omniState.info.content_type !== "playlist"}- <div class="timerange-wrapper">- <span class="timerange-label">{$t('omnibox.timerange_label')}</span>- <div class="timerange-inputs">- <input class="timerange-input" type="text" placeholder={$t('omnibox.timerange_start')} bind:value={clipStart} spellcheck="false" inputmode="numeric" aria-label={$t('omnibox.timerange_start') as string} />- <span class="timerange-sep" aria-hidden="true">—</span>- <input class="timerange-input" type="text" placeholder={$t('omnibox.timerange_end')} bind:value={clipEnd} spellcheck="false" inputmode="numeric" aria-label={$t('omnibox.timerange_end') as string} />- </div>- <span class="timerange-hint">{$t('omnibox.timerange_hint')}</span>+ </div>+ {#if playlistLoading}+ <div class="playlist-status"><span class="feedback-spinner"></span> {$t('omnibox.playlist_loading')}</div>+ {:else if playlistEntries.length === 0}+ <span class="playlist-status">{$t('omnibox.playlist_empty')}</span>+ {:else}+ <ul class="playlist-list">+ {#each playlistEntries as entry (entry.index)}+ <li>+ <label class="playlist-item">+ <input type="checkbox" checked={selectedPlaylistItems.has(entry.index)} onchange={() => togglePlaylistItem(entry.index)} />+ <span class="playlist-idx">{entry.index}.</span>+ <span class="playlist-title">{entry.title}</span>+ </label>+ </li>+ {/each}+ </ul>+ {/if}+ </div>+ {/if}+ {#if torrentLoading || torrentEntries.length > 0}+ <div class="playlist-picker">+ <div class="playlist-head">+ <span class="playlist-count">+ {$t('omnibox.torrent_selected', { selected: selectedTorrentFiles.size, total: torrentEntries.length })}+ </span>+ {#if !torrentLoading && torrentEntries.length > 0}+ <div class="playlist-bulk">+ <button type="button" class="playlist-link" onclick={selectAllTorrent}>{$t('omnibox.playlist_all')}</button>+ <button type="button" class="playlist-link" onclick={selectNoneTorrent}>{$t('omnibox.playlist_none')}</button></div>{/if}- <div class="timerange-wrapper">- <span class="timerange-label">{$t('omnibox.schedule_label')}</span>- <div class="schedule-presets">- <button type="button" class="schedule-preset" onclick={() => setSchedulePreset('1h')}>{$t('omnibox.schedule_1h')}</button>- <button type="button" class="schedule-preset" onclick={() => setSchedulePreset('tonight')}>{$t('omnibox.schedule_tonight')}</button>- <button type="button" class="schedule-preset" onclick={() => setSchedulePreset('1d')}>{$t('omnibox.schedule_1d')}</button>- {#if scheduleAt || scheduleStop}- <button type="button" class="schedule-preset" onclick={() => { scheduleAt = ""; scheduleStop = ""; }}>{$t('omnibox.schedule_clear')}</button>- {/if}- </div>- <div class="timerange-inputs schedule-row">- <input class="timerange-input schedule-date" type="date" value={schedulePart(scheduleAt, "date")} oninput={(e) => { scheduleAt = withSchedulePart(scheduleAt, "date", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_start') as string} />- <input class="timerange-input schedule-time" type="time" step="60" value={schedulePart(scheduleAt, "time")} oninput={(e) => { scheduleAt = withSchedulePart(scheduleAt, "time", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_start') as string} />- <span class="timerange-sep" aria-hidden="true">—</span>- <input class="timerange-input schedule-date" type="date" value={schedulePart(scheduleStop, "date")} oninput={(e) => { scheduleStop = withSchedulePart(scheduleStop, "date", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_stop') as string} />- <input class="timerange-input schedule-time" type="time" step="60" value={schedulePart(scheduleStop, "time")} oninput={(e) => { scheduleStop = withSchedulePart(scheduleStop, "time", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_stop') as string} />- </div>- <span class="timerange-hint">{$t('omnibox.schedule_hint')}</span>- </div>- <FormatSelector- platform={omniState.info.platform}- isPlaylist={omniState.info.content_type === "playlist"}- bind:formats- bind:selectedFormatId- {loadingFormats}- {formatError}- onLoadFormats={loadFormats}- onSelectFormat={selectFormat}- onClearFormat={clearFormatSelection}- onPresetBest={presetBest}- onPresetMusic={presetMusic}- /></div>- </details>+ {#if torrentLoading}+ <div class="playlist-status"><span class="feedback-spinner"></span> {$t('omnibox.torrent_loading')}</div>+ {:else}+ <ul class="playlist-list">+ {#each torrentEntries as entry (entry.index)}+ <li>+ <label class="playlist-item">+ <input type="checkbox" checked={selectedTorrentFiles.has(entry.index)} onchange={() => toggleTorrentFile(entry.index)} />+ <span class="playlist-title">{entry.path}</span>+ <span class="torrent-size">{formatBytes(entry.size_bytes)}</span>+ </label>+ </li>+ {/each}+ </ul>+ {/if}+ </div>+ {/if}+ {#if cookieHint}+ <p class="cookie-hint" class:expired={cookieHint === "expired"} role="status">+ <span>{cookieHint === "expired" ? $t("omnibox.cookie_hint_expired") : $t("omnibox.cookie_hint_stale")}</span>+ <button type="button" class="cookie-hint-link" onclick={() => goto("/settings?tab=cookies")}>{$t("omnibox.cookie_hint_action")}</button>+ </p>+ {/if}+ {#if COURSE_PLATFORMS.has(omniState.info.platform)}+ {#if coursesPluginInstalled === false}+ <p class="course-upsell">{$t('omnibox.courses_plugin_needed')}</p>+ <button class="download-primary-btn" onclick={() => goto("/marketplace")}>{$t('omnibox.install_courses_plugin')}</button>+ {:else}+ <p class="course-upsell">{$t('omnibox.courses_plugin_ready')}</p>+ <button class="download-primary-btn" onclick={handleAction}>{$t(omniState.info.platform === "udemy" ? 'omnibox.go_to_udemy' : 'omnibox.go_to_hotmart')}</button>+ {/if}+ {:else}+ {@const playlistBlocked = omniState.info.content_type === "playlist" && playlistEntries.length > 0 && selectedPlaylistItems.size === 0}+ {@const torrentBlocked = torrentEntries.length > 0 && selectedTorrentFiles.size === 0}+ {#if omniState.info.platform === "bilibili"}+ <BilibiliPreviewExtras {url} accountSlug={selectedCookieSlug && selectedCookieSlug !== "_anonymous" ? selectedCookieSlug : null} />+ {/if}+ <button class="download-primary-btn" disabled={playlistBlocked || torrentBlocked} onclick={handleAction}>{$t('omnibox.download')}</button>+ {#if omniState.info.platform !== "direct_file"}+ <details class="options-panel">+ <summary class="options-toggle">{$t('omnibox.options')}</summary>+ <div class="options-content">+ <DownloadModeSelector bind:downloadMode onChange={() => { selectedFormatId = null; }} />+ {#if downloadMode !== "audio"}+ <QualityPicker bind:selectedQuality {selectedFormatId} {availableHeights} {hasAudioOnly} />+ {/if}+ {#if cookieAccounts.length > 1}+ <CookieAccountPicker accounts={cookieAccounts} bind:selectedSlug={selectedCookieSlug} />+ {/if}+ <details class="options-panel">+ <summary class="options-toggle">{$t('omnibox.advanced')}</summary>+ <div class="options-content">+ {#if omniState.info.platform === "vimeo" || omniState.info.platform === "generic"}+ <div class="referer-input-wrapper">+ <label class="referer-label" for="referer-input">{$t('omnibox.referer_label')}</label>+ <input id="referer-input" class="referer-input" type="text" placeholder={$t('omnibox.referer_placeholder')} bind:value={referer} spellcheck="false" />+ </div>+ {/if}+ {#if omniState.info.content_type !== "playlist"}+ <div class="timerange-wrapper">+ <span class="timerange-label">{$t('omnibox.timerange_label')}</span>+ <div class="timerange-inputs">+ <input class="timerange-input" type="text" placeholder={$t('omnibox.timerange_start')} bind:value={clipStart} spellcheck="false" inputmode="numeric" aria-label={$t('omnibox.timerange_start') as string} />+ <span class="timerange-sep" aria-hidden="true">—</span>+ <input class="timerange-input" type="text" placeholder={$t('omnibox.timerange_end')} bind:value={clipEnd} spellcheck="false" inputmode="numeric" aria-label={$t('omnibox.timerange_end') as string} />+ </div>+ <span class="timerange-hint">{$t('omnibox.timerange_hint')}</span>+ </div>+ {/if}+ <div class="timerange-wrapper">+ <span class="timerange-label">{$t('omnibox.schedule_label')}</span>+ <div class="schedule-presets">+ <button type="button" class="schedule-preset" onclick={() => setSchedulePreset('1h')}>{$t('omnibox.schedule_1h')}</button>+ <button type="button" class="schedule-preset" onclick={() => setSchedulePreset('tonight')}>{$t('omnibox.schedule_tonight')}</button>+ <button type="button" class="schedule-preset" onclick={() => setSchedulePreset('1d')}>{$t('omnibox.schedule_1d')}</button>+ {#if scheduleAt || scheduleStop}+ <button type="button" class="schedule-preset" onclick={() => { scheduleAt = ""; scheduleStop = ""; }}>{$t('omnibox.schedule_clear')}</button>+ {/if}+ </div>+ <div class="timerange-inputs schedule-row">+ <input class="timerange-input schedule-date" type="date" value={schedulePart(scheduleAt, "date")} oninput={(e) => { scheduleAt = withSchedulePart(scheduleAt, "date", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_start') as string} />+ <input class="timerange-input schedule-time" type="time" step="60" value={schedulePart(scheduleAt, "time")} oninput={(e) => { scheduleAt = withSchedulePart(scheduleAt, "time", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_start') as string} />+ <span class="timerange-sep" aria-hidden="true">—</span>+ <input class="timerange-input schedule-date" type="date" value={schedulePart(scheduleStop, "date")} oninput={(e) => { scheduleStop = withSchedulePart(scheduleStop, "date", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_stop') as string} />+ <input class="timerange-input schedule-time" type="time" step="60" value={schedulePart(scheduleStop, "time")} oninput={(e) => { scheduleStop = withSchedulePart(scheduleStop, "time", e.currentTarget.value); }} aria-label={$t('omnibox.schedule_stop') as string} />+ </div>+ <span class="timerange-hint">{$t('omnibox.schedule_hint')}</span>+ </div>+ <FormatSelector+ platform={omniState.info.platform}+ isPlaylist={omniState.info.content_type === "playlist"}+ bind:formats+ bind:selectedFormatId+ {loadingFormats}+ {formatError}+ onLoadFormats={loadFormats}+ onSelectFormat={selectFormat}+ onClearFormat={clearFormatSelection}+ onPresetBest={presetBest}+ onPresetMusic={presetMusic}+ />+ </div>+ </details>+ </div>+ </details>+ {/if}+ {/if}+ {:else if omniState.kind === "preparing"}+ <div class="feedback-card feedback-enter">+ <div class="card-row">+ <span class="feedback-spinner"></span>+ <span class="card-text">{$t('omnibox.preparing')}</span>+ </div></div>- </details>- {/if}- {/if}- {:else if omniState.kind === "preparing"}- <div class="feedback-card feedback-enter">- <div class="card-row">- <span class="feedback-spinner"></span>- <span class="card-text">{$t('omnibox.preparing')}</span>- </div>- </div>- {:else if omniState.kind === "error"}- <div class="feedback-card feedback-enter" data-status="error">- <div class="card-row">- <span class="card-title card-error-text">{omniState.message}</span>- </div>- <div class="card-row card-actions">- <button class="button card-action-btn" onclick={handleRetry}>{$t('omnibox.retry')}</button>- </div>+ {:else if omniState.kind === "error"}+ <div class="feedback-card feedback-enter" data-status="error">+ <div class="card-row">+ <span class="card-title card-error-text">{omniState.message}</span>+ </div>+ <div class="card-row card-actions">+ <button class="button card-action-btn" onclick={handleRetry}>{$t('omnibox.retry')}</button>+ </div>+ </div>+ {/if}+ </HomeInspector></div>- {/if}- </HomeInspector>+ </div></div>-- </div>{/if}{#if showP2pSendDialog}@@ -1275,11 +1301,6 @@onReject={handleP2pReject}/>{/if}-- <div class="terms-note">- {$t('terms_note.agreement')}- <a href="/about/terms" class="terms-link">{$t('terms_note.link')}</a>- </div></div><style>@@ -1299,9 +1320,12 @@.feedback {display: flex;align-items: center;+ justify-content: center;gap: 6px;min-height: 20px;padding: 0 var(--space-1);+ color: var(--text-muted);+ width: 100%;}.feedback-icon {@@ -1310,7 +1334,7 @@}.feedback[data-supported="true"] {- color: var(--success);+ color: var(--text-muted);}.feedback[data-supported="false"] {@@ -1322,9 +1346,30 @@font-weight: 500;}- .feedback-sep {- opacity: 0.5;- margin: 0 2px;+ .added-notice {+ gap: var(--space-2);+ font-size: var(--text-sm);+ }++ .added-notice-title {+ font-weight: 600;+ color: var(--text);+ }++ .added-notice-link {+ background: none;+ border: none;+ padding: 0;+ font: inherit;+ font-size: var(--text-sm);+ font-weight: 600;+ color: var(--accent-hi);+ cursor: pointer;+ }++ .added-notice-link:hover {+ text-decoration: underline;+ text-underline-offset: 2px;}.feedback-spinner {@@ -1789,20 +1834,6 @@color: var(--text-dim);}- .terms-note {- flex-shrink: 0;- font-size: var(--text-xs);- color: var(--text-faint);- text-align: center;- padding: var(--space-2) var(--space-1) var(--space-3);- }-- .terms-link {- color: var(--text-dim);- text-decoration: underline;- text-underline-offset: 2px;- }-@media (prefers-reduced-motion: reduce) {.feedback-enter {animation: none;