web/desktop: grid + subtitle fixes, comment toggle, faster startup

Several related UI and startup fixes from one session:

- Web grid: channel and music views rendered in a single column because
  their content was wrapped in one nested div that became a single cell of
  the outer CSS grid. Span the wrappers (and .empty) across all columns
  with grid-column:1/-1.

- Subtitles: route every track through /api/sub-vtt and strip per-cue
  position/alignment settings (align:start position:0% etc.) from both SRT
  and VTT, so auto-generated captions render centered instead of left-
  aligned. New strip_cue_settings/normalize_vtt + sub_vtt_url helpers.

- Comment downloads: add a global backup.fetch_comments toggle (the
  per-channel option already existed; it's now a tri-state override that
  defers to the global). Full five-touchpoint wiring across config,
  download_options, the downloader's apply_comments resolver, both UIs'
  global + per-channel controls, and downloader seeding.

- Desktop startup: run the initial library scan + search-index sync on a
  background thread (mirrors the web server's deferred bind) so the window
  appears immediately instead of blocking on a cold-cache scan; update()
  swaps the library in when it lands.

- Perceptual dedup: cap worker threads via fingerprint::default_workers()
  (~half the cores, always leaving at least one free) instead of using
  every core, so the hashing pass doesn't starve the UI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Luna 2026-06-10 01:43:50 -07:00
parent fdc7493eb9
commit aed577ea2f
7 changed files with 245 additions and 50 deletions

View file

@ -112,12 +112,14 @@ pub struct DownloadOptions {
#[serde(default)]
pub extra_args: Vec<String>,
/// Embed video comments into the info.json sidecar (yt-dlp
/// `--write-comments`). Off by default because comment download is slow
/// — yt-dlp paginates through thousands of replies for popular videos.
/// When on, the web UI's player modal exposes a Comments tab.
/// Per-channel override for fetching video comments into the info.json
/// sidecar (yt-dlp `--write-comments`). `None` defers to the global
/// `backup.fetch_comments`; `Some(true)`/`Some(false)` forces it on/off
/// for this channel. Resolved in the downloader's comment resolver, which
/// merges this with the global default. When on, the player's Comments
/// tab is populated (comment download is slow on popular videos).
#[serde(default)]
pub fetch_comments: bool,
pub fetch_comments: Option<bool>,
/// Skip yt-dlp's channel-tab authentication sanity check by passing
/// `--extractor-args youtubetab:skip=authcheck`.
@ -179,9 +181,9 @@ impl DownloadOptions {
cmd.arg(arg);
}
}
if self.fetch_comments {
cmd.arg("--write-comments");
}
// Comment fetching (--write-comments) is emitted by the downloader's
// comment resolver, which merges this per-channel override with the
// global backup.fetch_comments default. apply() handles the rest.
if self.skip_auth_check {
// Its own --extractor-args flag; the youtubetab: namespace is
// distinct from the POT provider's youtubepot-bgutilhttp: one,