From 897c9efbe96019b98c82075861b72b31286f700c Mon Sep 17 00:00:00 2001 From: astar76 Date: Wed, 25 Nov 2026 13:57:12 -0600 Subject: [PATCH] S012: the choice of a stream is kept, plan done Co-Authored-By: Claude Opus 5.5 --- Plans/02 Engine/S012-streams.md | 14 +++++++------- Plans/INDEX.md | 2 +- crates/core/src/manager/actor.rs | 3 ++- crates/core/src/model.rs | 3 +++ crates/core/src/store/005.sql | 1 + crates/core/src/store/mod.rs | 2 +- crates/core/src/store/rows.rs | 10 ++++++---- crates/core/tests/stream.rs | 8 ++++++++ docs/DECISIONS.md | 3 +++ docs/PROGRESS.md | 10 ++++++++++ 10 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 crates/core/src/store/005.sql diff --git a/Plans/02 Engine/S012-streams.md b/Plans/02 Engine/S012-streams.md index 9a97ffe..382ba70 100644 --- a/Plans/02 Engine/S012-streams.md +++ b/Plans/02 Engine/S012-streams.md @@ -11,13 +11,13 @@ FEATURES 1.10, 1.11, ffmpeg runner used by media plans. - docs/DECISIONS.md D-011 ## Steps -- [ ] ffmpeg finder and runner: argument lists only, progress parsing, cancel, log tail, missing-tool error kind -- [ ] HLS: master and media lists, variants, audio groups, AES-128 clear-key as the list itself offers; live lists record until stopped -- [ ] DASH: static and simple dynamic manifests, representation choice -- [ ] Fragments in parallel with retry, resume after restart, joined without re-encoding -- [ ] RTSP and MMS recorded through ffmpeg with stop and size or time limit -- [ ] DRM (Widevine, FairPlay, PlayReady signals) is recognised and refused with a plain message -- [ ] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S012: …`, push +- [x] ffmpeg finder and runner: argument lists only, progress parsing, cancel, log tail, missing-tool error kind +- [x] HLS: master and media lists, variants, audio groups, AES-128 clear-key as the list itself offers; live lists record until stopped +- [x] DASH: static and simple dynamic manifests, representation choice +- [x] Fragments in parallel with retry, resume after restart, joined without re-encoding +- [x] RTSP and MMS recorded through ffmpeg with stop and size or time limit +- [x] DRM (Widevine, FairPlay, PlayReady signals) is recognised and refused with a plain message +- [x] `docs/PROGRESS.md` entry, tick `Plans/INDEX.md`, commit `S012: …`, push ## End criteria - `nice cargo test -j 2 -p medlar-core --test stream` green on fixtures made by ffmpeg diff --git a/Plans/INDEX.md b/Plans/INDEX.md index 35f8867..08a322c 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -20,7 +20,7 @@ Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H - [x] [S009](02%20Engine/S009-mirrors-checksums.md) Mirrors, Metalink and checksums - [x] [S010](02%20Engine/S010-logins-proxies.md) Logins, cookies and proxies - [x] [S011](02%20Engine/S011-ftp-sftp.md) FTP, FTPS and SFTP -- [ ] [S012](02%20Engine/S012-streams.md) HLS, DASH, RTSP and MMS +- [x] [S012](02%20Engine/S012-streams.md) HLS, DASH, RTSP and MMS ## 03 Interface diff --git a/crates/core/src/manager/actor.rs b/crates/core/src/manager/actor.rs index 6248354..6c0f41b 100644 --- a/crates/core/src/manager/actor.rs +++ b/crates/core/src/manager/actor.rs @@ -858,6 +858,7 @@ impl Actor { t.checksum = new.checksum.map(verify::plain); t.max_parts = new.max_parts; t.tries = new.tries; + t.stream = new.stream; t.speed_limit = new.speed_limit; t.headers = new.headers; t.proxy = new.proxy; @@ -1056,7 +1057,7 @@ impl Actor { let work = tokio::spawn(async move { let source = site::source(sites.as_ref(), &task, &stopped).await?; if stream::kind_of(&task).is_some() { - let request = stream::Request { id, source, choice: Default::default(), tools: &Tools::find(), options: &options }; + let request = stream::Request { id, source, choice: task.stream.clone().unwrap_or_default(), tools: &Tools::find(), options: &options }; return stream::download(&shared, request, &monitor, stopped).await; } download(&shared, id, source, &options, &monitor, stopped).await diff --git a/crates/core/src/model.rs b/crates/core/src/model.rs index c125580..f24e465 100644 --- a/crates/core/src/model.rs +++ b/crates/core/src/model.rs @@ -192,6 +192,8 @@ pub struct Task { /// Keyring item with the cookies and login. pub secret: Option, pub after: Option, + /// What was chosen of a stream. None is the best of it, for as long as it goes on. + pub stream: Option, /// The unfinished one this starts over. Removed when this is done. pub replaces: Option, pub start_at: Option