mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-22 03:05:32 +02:00
feat(core): playlist per-item quality + incremental sync
ytdlp.rs:
- Add PlaylistItemProbe / PlaylistProbeResult (pub, serde::Serialize)
- Add private available_video_heights_from_value() helper for Value entries
- Add probe_playlist_qualities(): yt-dlp -J (full metadata, no flat flag)
returns per-video quality lists in one subprocess call
capture.rs:
- Add per_item_quality: HashMap<String,String> and sync: bool to CaptureConfig
(both Default; keyed by yt-dlp video ID, not URL)
- Add pub locator_to_playlist_url(): validates only the three playlist sources,
expands shorthands; keeps locator_to_ytdlp_url's no-playlists contract
- Playlist capture block: sync-aware container resolution
- sync + existing container → reuse it via complete_archive_run_item,
skip already-archived children (by canonical URL) before creating
run items so refresh_run_counters only counts new items
- sync + no container → create normally (first sync run)
- non-sync → always create fresh container (existing behaviour)
- Per-item quality: config.per_item_quality.get(id) falls back to child_quality
archive.rs:
- Add get_archived_playlist_child_urls(): returns HashSet of canonical URLs
of all children under any container matching the playlist canonical URL
- Add find_container_entry_id_by_canonical_url(): returns most-recent
container entry id (parent_entry_id IS NULL) for a given canonical URL
routes.rs: stub per_item_quality/sync on both CaptureConfig sites (server
agent will wire body fields in Phase 2)
This commit is contained in:
parent
9c1d416463
commit
814aa76a1d
4 changed files with 277 additions and 26 deletions
|
|
@ -879,6 +879,8 @@ async fn capture_handler(
|
|||
modal_closer_enabled: Some(effective_modal_closer),
|
||||
reader_mode: body.reader_mode.unwrap_or(false),
|
||||
via_freedium: body.via_freedium.unwrap_or(true),
|
||||
per_item_quality: std::collections::HashMap::new(),
|
||||
sync: false,
|
||||
};
|
||||
|
||||
// Spawn background capture.
|
||||
|
|
@ -998,6 +1000,8 @@ async fn rearchive_handler(
|
|||
modal_closer_enabled: None,
|
||||
reader_mode: false,
|
||||
via_freedium: false,
|
||||
per_item_quality: std::collections::HashMap::new(),
|
||||
sync: false,
|
||||
};
|
||||
|
||||
let job_uid_bg = job_uid.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue