Add SFV panel: compute/verify CRC32/MD5/SHA1 checksums, .sfv/.md5/.sha1 sidecar files

Fully local feature - no network access, no credentials. New aurora-curator-core::sfv
module streams file hashing in 64KB chunks and handles both the traditional .sfv
format (CRC32, "name checksum" layout) and the GNU coreutils md5sum/sha1sum sidecar
convention (.md5/.sha1, "checksum  name" layout), dispatched on a shared ChecksumKind
enum. New src-tauri/src/sfv.rs wraps it in three Tauri commands - compute_checksums
(per-file error isolation), save_checksum_file (native Save dialog), and
verify_checksum_file (resolves each entry against the checksum file's own parent
directory, reports OK/Mismatch/Missing per entry). New SfvPanel.tsx/.css wires it all
into the sidebar's SFV screen - load files, pick a checksum type, Compute, Save, or
Verify against an existing checksum file.

14 new core-crate tests + 1 new src-tauri test, all passing (workspace: 160/160).
Verified end-to-end with a 22-check Playwright script against npm run dev.
This commit is contained in:
Renamr Scaffold
2026-08-29 15:59:05 +00:00
parent ed26391651
commit 316dbfc1ff
11 changed files with 940 additions and 8 deletions
+60 -8
View File
@@ -45,7 +45,10 @@ result, and the subtitle is saved right next to the video ready for any player t
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.
separate credentials needed; see "Episodes" below. A new SFV panel computes and verifies
CRC32/MD5/SHA1 checksums for a loaded set of files, and reads and writes the classic
`.sfv`/`.md5`/`.sha1` sidecar-file formats — entirely local, no network access or
credentials of any kind; see "SFV" 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
@@ -161,7 +164,16 @@ crates/aurora-curator-core/ Pure Rust core: naming-expression engine (ported),
(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
exactly what it browses. `sfv/` computes CRC32/MD5/SHA1 checksums
(streamed in 64KB chunks so large video files aren't loaded whole
into memory) and parses/builds both sidecar-file conventions the
SFV panel supports — the traditional `.sfv` layout (CRC32 only,
`<name> <checksum>` per line) and the GNU coreutils
`md5sum`/`sha1sum` layout (`<checksum> <name>`) used for `.md5`/
`.sha1` — dispatched on a shared `ChecksumKind` enum, plus
entry-verification against real files on disk (`Ok`/`Mismatch`/
`Missing` per entry). No network access, no credentials — entirely
local, unlike every other panel added this session. The on-disk
rename engine (`rename/` — Move/Copy/Symlink actions,
Skip/Auto-number/Override conflict policies, can also organize
into (auto-created) subfolders when
@@ -192,7 +204,14 @@ src-tauri/ Tauri app shell: exposes aurora-curator-core as commands
`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),
same stored TV-source setting and credential), `sfv.rs` (three
commands backing the SFV panel — `compute_checksums` over a batch
of loaded files with per-file error isolation, `save_checksum_file`
via a native "Save File" dialog, and `verify_checksum_file`, which
reads and parses a picked `.sfv`/`.md5`/`.sha1` file and resolves
each entry's bare filename relative to that file's own parent
directory — all wrapping `aurora-curator-core::sfv`, which does the
actual algorithm/format work),
`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
@@ -219,6 +238,13 @@ src/ React + TypeScript UI (Vite). Faithful recreation of the
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.
`SfvPanel.tsx` is the third: load a set of files, compute
checksums in any of CRC32/MD5/SHA1, save them as a sidecar
checksum file via a native Save dialog, or pick an existing
checksum file and verify the files it lists against what's
actually on disk (OK/mismatch/missing per entry) — no settings
modal at all, since the feature needs no credentials or network
access.
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.
@@ -243,7 +269,7 @@ npm run tauri dev
npm run tauri build
```
Verified in the environment this was built in: `cargo test --workspace` (all 145
Verified in the environment this was built in: `cargo test --workspace` (all 160
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
@@ -391,6 +417,30 @@ to its own interface once it's saved (every other credential's "already saved" c
does briefly see the real value; the password doesn't), and the Settings panel only ever
shows *whether* a password is on file, never the value itself.
## SFV
The SFV sidebar panel computes and verifies file checksums — CRC32, MD5, or SHA1 — and
reads and writes the classic sidecar checksum-file formats, recreating original
FileBot's SFV panel. Unlike every other panel added this session, it's **entirely
local**: no network access, no credentials, nothing to configure.
**Load Files…** picks one or more files, then choose a checksum type from the segmented
control (CRC32 defaults to the traditional `.sfv` file format; MD5/SHA1 use the GNU
coreutils `md5sum`/`sha1sum` sidecar convention instead). **Compute** hashes every loaded
file (streamed in 64KB chunks, so even large video files don't need to fit in memory) and
lists each one's checksum, or an **ERROR** badge for any individual file that couldn't be
read — one bad file never aborts the rest of the batch. **Save Checksum File…** opens a
native Save dialog (defaulted to the loaded files' own folder name, e.g. `movies.sfv`)
and writes every successfully-computed checksum out in the chosen format; only files that
computed successfully are included.
**Verify Checksum File…** goes the other direction: pick an existing `.sfv`/`.md5`/
`.sha1` file (no need to have loaded its files first) and every entry it lists is
resolved against the real files sitting next to it on disk and reported as **OK**,
**MISMATCH** (actual checksum shown alongside the expected one), or **MISSING** (the
referenced file isn't there). Checksum comparison is case-insensitive, since some tools
write hex digests in uppercase and others in lowercase.
## Porting roadmap (not yet done)
Roughly in priority order — each references the original FileBot source file it's
@@ -490,10 +540,12 @@ 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
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
are the Subtitles panel (search + download via OpenSubtitles, see "Subtitles" above),
the Episodes panel (series search + season browse with a Copy list export, no
credentials of its own, see "Episodes" above), and the SFV panel (compute/verify
CRC32/MD5/SHA1 checksums, read/write `.sfv`/`.md5`/`.sha1` sidecar files, entirely
local with no credentials at all, see "SFV" above) — the first three of the other
five sidebar panels to become real screens. The remaining two (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.