Add Episodes panel: search a series, browse a season's episode list
New src-tauri/src/episodes.rs exposes browse_episodes, reusing the existing AnyTvClient::fetch_season machinery Fetch Data already built (via a build_tv_client helper factored out of metadata.rs) so this panel needs no credentials of its own - it reads whatever TV source (TMDB/TVmaze/OMDb) is already configured in Fetch Data Settings. New EpisodesPanel.tsx/.css: series name + season stepper, an episode list (number/title/air date), and a Copy list button that copies the season as plain text. Wired into App.tsx's sidebar routing as the second stub panel (after Subtitles) to become a real screen. 145/145 Rust tests passing (+1), npm run build clean, 15/15 Playwright checks against npm run dev (mocked Tauri bridge) covering search, the empty-season case, a not-found series, the season stepper, Copy list, and the blank-query guard.
This commit is contained in:
@@ -42,7 +42,10 @@ below. A new Subtitles panel searches and downloads subtitle files from
|
||||
[OpenSubtitles](https://www.opensubtitles.com/) — load a video, its title/season/episode
|
||||
(or movie title/year) auto-fills from the same local matching "Match" uses, pick a
|
||||
result, and the subtitle is saved right next to the video ready for any player to pick
|
||||
up automatically; see "Subtitles" below. See "Porting roadmap" below.
|
||||
up automatically; see "Subtitles" below. A new Episodes panel searches a series by
|
||||
name and browses a full season's episode list — episode number, title, air date — using
|
||||
whichever TV source (TMDB/TVmaze/OMDb) is already configured in Fetch Data Settings, no
|
||||
separate credentials needed; see "Episodes" below. See "Porting roadmap" below.
|
||||
|
||||
The naming scheme is fully user-editable from the app (the "Naming Scheme" button next
|
||||
to the New Names list) — the default is `{show name} - {season number}x{episode
|
||||
@@ -153,7 +156,12 @@ crates/aurora-curator-core/ Pure Rust core: naming-expression engine (ported),
|
||||
download against OpenSubtitles' REST API; search only needs an
|
||||
app-level API key, download additionally needs the end user's own
|
||||
account login, since downloads are quota-limited per account —
|
||||
see "Subtitles" below), the on-disk
|
||||
see "Subtitles" below). The Episodes panel adds no new core-crate
|
||||
code of its own — it reuses `metadata::AnyTvClient::fetch_season`
|
||||
(the same season-resolving call `AnyTvClient` already made available
|
||||
to "Fetch Data" and the CLI) from the Tauri side, so `web/tmdb.rs`/
|
||||
`tvmaze.rs`/`omdb.rs`'s existing season-episode-list methods are
|
||||
exactly what it browses. The on-disk
|
||||
rename engine (`rename/` — Move/Copy/Symlink actions,
|
||||
Skip/Auto-number/Override conflict policies, can also organize
|
||||
into (auto-created) subfolders when
|
||||
@@ -180,7 +188,11 @@ src-tauri/ Tauri app shell: exposes aurora-curator-core as commands
|
||||
returns to the frontend, only whether one is saved),
|
||||
`subtitles.rs` (search/download commands wrapping
|
||||
`aurora-curator-core::web::opensubtitles`, saving a downloaded
|
||||
subtitle right next to its video file),
|
||||
subtitle right next to its video file), `episodes.rs` (the
|
||||
`browse_episodes` command backing the Episodes panel — series
|
||||
search + one season's episode list, via a `build_tv_client` helper
|
||||
now shared with `metadata.rs`'s `fetch_metadata`, so both read the
|
||||
same stored TV-source setting and credential),
|
||||
`history.rs` (rename history/undo
|
||||
log), `presets.rs` (up to 9 saved naming schemes) — all three
|
||||
stored as JSON in the OS app-config directory — `cli.rs` (the
|
||||
@@ -203,6 +215,10 @@ src/ React + TypeScript UI (Vite). Faithful recreation of the
|
||||
panel (its own Subtitle Settings modal, its own credential state)
|
||||
reached from the sidebar's "Subtitles" entry — the first sidebar
|
||||
entry besides Rename to be a real screen rather than a stub.
|
||||
`EpisodesPanel.tsx` is the second: a series-search + season-browse
|
||||
screen with no settings modal of its own at all — it deliberately
|
||||
has no separate credentials UI, reading whatever TV source/token
|
||||
Fetch Data Settings (in the Rename panel) already has saved.
|
||||
scripts/gen_icons.py Regenerates src-tauri/icons/ from the real logo mark
|
||||
(`scripts/logo/icon-source.png`, cropped from the supplied
|
||||
lockup) — replace that source image to change the look.
|
||||
@@ -227,7 +243,7 @@ npm run tauri dev
|
||||
npm run tauri build
|
||||
```
|
||||
|
||||
Verified in the environment this was built in: `cargo test --workspace` (all 144
|
||||
Verified in the environment this was built in: `cargo test --workspace` (all 145
|
||||
passing, including the TMDB, TVmaze, OMDb, and OpenSubtitles client tests — those run
|
||||
against a local mock HTTP server via `mockito`, no live network or API key needed to
|
||||
build/test), `cargo
|
||||
@@ -315,6 +331,28 @@ tree (see "Organizing into subfolders" above) — a naming scheme's own `/` alre
|
||||
organizing into a subfolder, and relaxing that invariant just for `--output` wasn't
|
||||
judged worth it.
|
||||
|
||||
## Episodes
|
||||
|
||||
The Episodes sidebar panel searches for a TV series by name and browses one season's
|
||||
full episode list — episode number, title, and air date — as a standalone reference,
|
||||
independent of whatever files (if any) are loaded in the Rename panel.
|
||||
|
||||
Type a series name, pick a season (the +/− stepper re-queries automatically once you've
|
||||
searched at least once), and click **Browse**. A season with a real series match but no
|
||||
episodes of its own (e.g. asking for season 99 of a 5-season show) comes back as a clear
|
||||
"no episodes found for season N" message rather than an error; a series name that
|
||||
doesn't match anything at all surfaces the underlying source's own not-found message. A
|
||||
**Copy list** button copies every row as plain text (`Series Name - SxEE - Episode
|
||||
Title`, one per line) to the clipboard — handy for pasting into a naming reference or
|
||||
anywhere outside the app.
|
||||
|
||||
Unlike Subtitles, this panel has **no settings or credentials of its own**: it reuses
|
||||
whichever TV source — TMDB, TVmaze, or OMDb — is already configured in the Rename
|
||||
panel's Fetch Data Settings, and the same season-lookup call ("Fetch Data" and the
|
||||
`-rename --db` CLI both already made) is exactly what it browses. If nothing is
|
||||
configured yet (only relevant for TMDB/OMDb — TVmaze needs no credential), Browse
|
||||
reports the same "open Settings to add one" message Fetch Data itself would.
|
||||
|
||||
## Subtitles
|
||||
|
||||
The Subtitles sidebar panel searches and downloads subtitle files from
|
||||
@@ -411,7 +449,10 @@ ported from, for anyone picking this up:
|
||||
items resolve against respectively (TMDB stays the default for both; a batch can mix
|
||||
sources across its TV and movie halves) — disambiguating multi-result searches via
|
||||
the similarity-scoring pass described in item 3 above rather than blindly trusting
|
||||
any source's top-ranked hit. **OpenSubtitles is also done, but as a subtitle source
|
||||
any source's top-ranked hit. The same per-season episode-list methods these three
|
||||
clients already exposed for Fetch Data are also what the new Episodes panel browses
|
||||
directly (see "Episodes" above) — no new client code, just a new UI on top of what
|
||||
was already there. **OpenSubtitles is also done, but as a subtitle source
|
||||
rather than a fourth title-metadata source** — `crates/aurora-curator-core/src/web/opensubtitles.rs`,
|
||||
wired to the new Subtitles panel (see "Subtitles" above) rather than to Fetch Data's
|
||||
TV/movie pickers, since it fetches subtitle files, not episode/movie titles. All
|
||||
@@ -449,9 +490,11 @@ ported from, for anyone picking this up:
|
||||
7. **The rest of the UI** — the Rename panel (file loading, drag-drop, live preview,
|
||||
local TV/movie matching, confirmed rename with per-item exclude, rename history/undo,
|
||||
Align Up/Down reordering, naming-scheme Presets with `1`-`9` hotkeys) is built, and so
|
||||
is the Subtitles panel (search + download via OpenSubtitles, see "Subtitles" above) —
|
||||
the first of the other five sidebar panels to become a real screen. The remaining
|
||||
four (Episodes/SFV/Filter/List) are still stub screens. Align Up/Down is button-based
|
||||
are the Subtitles panel (search + download via OpenSubtitles, see "Subtitles" above)
|
||||
and the Episodes panel (series search + season browse with a Copy list export, no
|
||||
credentials of its own, see "Episodes" above) — the first two of the other five
|
||||
sidebar panels to become real screens. The remaining three (SFV/Filter/List) are
|
||||
still stub screens. Align Up/Down is button-based
|
||||
(swaps the selected file with its neighbor), not the original's
|
||||
drag-and-drop-within-a-list interaction.
|
||||
8. **Undo/history for renames** — done, as a flat JSON-backed undo stack rather than a
|
||||
|
||||
Reference in New Issue
Block a user