S016: Add dialog, batch and duplicates

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-25 14:03:30 -06:00
commit 08488b4df2
2 changed files with 2809 additions and 78 deletions

View file

@ -58,3 +58,6 @@
- D-056 — 2026-11-25 — Streams are kept as pieces in one unfinished file with a record before each (`stream::tape`), and joined by ffmpeg with `-c copy` from sockets of this user: mp4 (m4a for sound alone) or what the name asks for, mkv where that can't hold it. — One file moves and bins like any other; needs twice, not three times the space. — 02, 06
- D-057 — 2026-11-25 — ffmpeg never opens links of lists: Medlar fetches all of HLS and DASH itself (proxy, logins, limits), and ffmpeg may open only `unix` sockets and known formats. For RTSP and MMS it connects itself, never when a proxy is set; logins go through its standard input. — Lists come from strangers; arguments are seen by all. — 02, 06
- D-058 — 2026-11-25 — Any sign of protection refuses the whole stream (`ErrorKind::Drm`): `ContentProtection`, keys other than AES-128 with `identity`, protected boxes in the first piece. — CLAUDE.md 4. — 02, 06
- D-059 — 2026-11-25 — A pasted link is looked at 0.5 s after the last change, without being kept; links of a batch are not. A list makes 10,000 downloads at most, the rest is counted and said. Patterns count in what the user writes, never in what programs and files give. — One-time links, servers and the user's patience. — 03, 05
- D-061 — 2026-11-25 — A task's keyring items are named `task:…`, one per site and login of what was added together, and deleted by the manager with the last task that has them. Folders by type and the recent ones are in `view.json`. A start time is a `Waiting` task with `Hold::Until`. — No secrets stay behind; no new setting. — 03, 04, 05
- D-071 — 2026-11-25 — What the list knows comes first in the dialog: the same link or checksum offers Resume or Show, a likely match offers Continue; `Same` goes on at once, all other verdicts are shown before a second click, `Different` leaves only a new file. The same name alone changes nothing: the new file gets a number. — Nothing is lost or loaded twice by accident. — 03, 05

View file

@ -182,3 +182,15 @@ Seen: tested in a second checkout on the shared target; S009 saw stale artifacts
## Later
-
## S016 — Add dialog, batch and duplicates (2026-11-25)
Done: `views::add` (dialog, batch, duplicates, "Continue from a new link"), `core::{batch, duplicate, portal}`. Choices: D-059, D-061, D-071. Outside the plan's files: `Manager::probe` and `Hold::Until` for start times, `secret::task_name`, `Sites::source_with`, `disk::free`, `bridge` (add, check, probe, poll), `dialog::shown`, `view.json` (folders), strings.
Verified: `nice cargo test -j 2 -p medlar --test add` green (14, four with the real engine), all medlar tests, core `--lib`, auth, manager, relink; clippy. Shots seen: empty, simple, advanced, error, batch, duplicate, continue, relink, at 1080×720 and simple at 480×360, some light, some dark. Built in a copy of the tree while S009 and S012 were half done.
- **Open it from outside: `app.main.adding.ask(views::add::Request { text, literal: true, name, size, mime, page, user_agent, cookies, headers, .. })`**; several wait in line (100 at most). `literal` for all that comes from a program (no patterns), `list` for a file with links. Cookies and secret headers end up in the keyring, not in the task.
- `adding.relink(&task)` asks for a new link; it compares first. "Get it from its page" sends `AwaitLink` and opens the page.
- `manager.probe(task, secret)` says what a link leads to (`Probed`); drop the reply to end it. `bridge::poll(&mut reply, ctx)` asks without waiting and draws a frame when it comes; `bridge::beside` runs something slow.
- Keyring: items named by `secret::task_name()` are deleted when no task has them any more (forgotten, edited, continued, removed before the program ended); shared ones stay. Other names (`site:`) are never touched.
- `Batch::of(text, patterns)`, `duplicate::Known::new(tasks).find(&New)`: for the connector, clipboard and rules.
Not done: the desktop's file chooser (portal) was never tried, only that it fails plainly is in the code; links of a batch are not asked about; what is known is found when the fields change, not when the list does; a start time is kept but queue schedules are S021's, and time asleep doesn't count; a metalink file is refused as a list (`read_metalink` is not wired, 3.3); files already on disk but not in the list are not noticed (the engine numbers names); no hidden release run.
Later: `App` doesn't set `ClientOptions::known_hosts` yet (S011).
Seen: boxes were ticked together after the tests, against rule 3.