Enhance comment viewer + make SponsorBlock configurable (3.6 + parity)
Comment viewer (web UI): the flat tree gains search (highlight + keep ancestor context), sort (threaded / top / newest / oldest), per-thread collapse/expand with collapse-all/expand-all, an OP badge for the uploader, and a "new since last visit" highlight + count (localStorage per-video timestamp). API now returns each comment's `timestamp` and `author_is_uploader`. SponsorBlock: was a hardcoded `--sponsorblock-mark all`. Now a real setting (off / mark / remove) with a per-channel override, threaded through the full five touchpoints — config `[backup].sponsorblock_mode` (default "mark", preserving prior behavior), DownloadOptions override, a downloader resolver (apply_sponsorblock), and both UIs (egui Settings + channel dialog; web Settings modal + channel dialog + SettingsPayload). Integration tests extended: settings round-trip asserts the sponsorblock default + persistence; channel-options round-trip asserts the override. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6f174f703b
commit
3031b5b0e5
7 changed files with 219 additions and 20 deletions
|
|
@ -127,10 +127,18 @@ pub struct BackupSection {
|
|||
/// live in [`crate::download_options::DownloadOptions`].
|
||||
#[serde(default)]
|
||||
pub youtube_player_clients: String,
|
||||
/// SponsorBlock handling for downloaded videos. `"mark"` (the default)
|
||||
/// chapter-marks segments via `--sponsorblock-mark all` so a player can
|
||||
/// skip them; `"remove"` cuts them from the file via
|
||||
/// `--sponsorblock-remove all`; `"off"` disables it. Per-channel
|
||||
/// overrides live in [`crate::download_options::DownloadOptions`].
|
||||
#[serde(default = "default_sponsorblock_mode")]
|
||||
pub sponsorblock_mode: String,
|
||||
}
|
||||
|
||||
fn default_max_concurrent() -> usize { 3 }
|
||||
fn default_true() -> bool { true }
|
||||
fn default_sponsorblock_mode() -> String { "mark".to_string() }
|
||||
|
||||
/// `[player]` table — external player and browser cookie source.
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
|
|
@ -264,6 +272,7 @@ impl Config {
|
|||
use_bundled_ytdlp: false,
|
||||
use_pot_provider: false,
|
||||
youtube_player_clients: String::new(),
|
||||
sponsorblock_mode: default_sponsorblock_mode(),
|
||||
},
|
||||
player: PlayerSection::default(),
|
||||
ui: UiSection::default(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue