Add local season/episode matching and on-disk rename (skip-on-conflict, confirm-first)

This commit is contained in:
Renamr Scaffold
2026-08-29 02:42:31 +00:00
parent d0c29048be
commit bab9bfa1ec
9 changed files with 851 additions and 24 deletions
+46 -19
View File
@@ -3,9 +3,14 @@
A fast, cross-platform media renamer — a ground-up rewrite of FileBot (via its FB-Mod
fork), built from scratch as its own project: new stack, new architecture, new branding.
**Status: early scaffold.** The naming-expression engine is ported and tested; the
matching engine, media metadata parsing, web datasource clients, rename engine, and the
real UI are not yet ported. See "Porting roadmap" below.
**Status: early scaffold, but the core loop works end to end.** The naming-expression
engine is ported and tested, the faithfully-recreated two-pane UI is wired to real
native file/folder loading and drag-and-drop, local filename-based season/episode
detection ("Match") is working, and the actual on-disk rename operation is wired up
(same-directory rename, skip-on-conflict, with a confirmation step showing the full
old-name/new-name plan before anything touches disk — there is no undo yet). Full
media-metadata bindings, the fuzzy similarity/matching engine, and online metadata
lookups are not yet ported. See "Porting roadmap" below.
## Why a rewrite, and why this stack
@@ -44,14 +49,21 @@ translate directly.
## Project layout
```
crates/renamr-core/ Pure Rust core: naming-expression engine (ported), and — not yet
ported — matching/similarity scoring, media metadata parsing,
web datasource clients (TMDB/TVDB/AniDB/etc), the rename engine.
No Tauri dependency, so it builds and unit-tests standalone.
src-tauri/ Tauri app shell: exposes renamr-core as commands to the frontend,
app metadata/icons/window config (tauri.conf.json).
src/ React + TypeScript UI (Vite). Currently a single proof-of-concept
screen wired to the live naming-expression preview.
crates/renamr-core/ Pure Rust core: naming-expression engine (ported), local
filename-based season/episode matching (ported, `matching/`), and
the on-disk rename engine (ported for the same-directory case,
`rename/`) — skip-on-conflict, no move/organize-into-folders yet.
Not yet ported: the fuzzy similarity engine, full media metadata
bindings, web datasource clients (TMDB/TVDB/AniDB/etc). No Tauri
dependency, so it builds and unit-tests standalone.
src-tauri/ Tauri app shell: exposes renamr-core as commands to the frontend
(naming-scheme rendering, filename matching, executing a rename
plan, native file/folder dialogs, drag-and-drop expansion), app
metadata/icons/window config (tauri.conf.json).
src/ React + TypeScript UI (Vite). Faithful recreation of the original
two-pane rename screen (Aurora theme) wired to real file loading,
drag-and-drop, live naming-scheme preview, local matching, and a
confirm-before-touching-disk modal for the actual rename.
scripts/gen_icons.py Regenerates src-tauri/icons/ (placeholder branding — swap the
colors/glyph in the script, or replace the icons directly, to
change the look).
@@ -96,18 +108,33 @@ ported from, for anyone picking this up:
Only a small subset (`any`, `all_of`, `concat`) is ported so far
(`crates/renamr-core/src/format/functions.rs`); Rhai's built-ins cover some of the
rest already.
3. **Matching/similarity engine** — `net.filebot.similarity.*`, especially
`EpisodeMetrics.java` (849 lines, the core fuzzy-matching score cascade) and
`SeriesNameMatcher`/`SeasonEpisodeMatcher`/`DateMatcher`.
3. **Matching/similarity engine** — `net.filebot.similarity.*`. Local filename-based
season/episode detection is done (`crates/renamr-core/src/matching`, ported from the
pattern-matching half of `SeasonEpisodeMatcher.java`, adapted to Rust's `regex` crate
which lacks lookahead/lookbehind — wired to the "Match" button). Still not ported:
`EpisodeMetrics.java` (849 lines, the fuzzy title-matching score cascade used once
there's an actual metadata source to score candidates against) and `DateMatcher`.
4. **Media detection** — `net.filebot.media.MediaDetection` (1356 lines): ties file-name
parsing + matching together to auto-identify what a file is.
5. **Web datasource clients** — `net.filebot.web.*` (~40 files): TheMovieDB, TheTVDB,
AniDB, OMDb, TVmaze, OpenSubtitles, etc. Use `reqwest` + `serde_json`/`serde`.
6. **Rename engine + CLI** — `net.filebot.cli.CmdlineOperations` (1235 lines) and
`ArgumentBean` (415 lines, the full flag surface: `-rename`, `--db`, `--format`,
`--action`, `--conflict`, `-get-subtitles`, `-script`, etc.) — flags are catalogued
in project notes but not yet implemented against real logic.
7. **Real UI** — file browser / drag-drop, rename preview table, settings, subtitle
panel. Current `src/App.tsx` is a single proof-of-concept screen.
8. **Packaging** — code signing, auto-update, installers per platform via
`--action`, `--conflict`, `-get-subtitles`, `-script`, etc.). The core same-directory
rename operation is done (`crates/renamr-core/src/rename`, fixed skip-on-conflict
policy, wired to the UI's Rename button behind a confirmation step). Not yet done:
the `--action` variants beyond rename-in-place (move/copy/symlink to a different
folder, which is what lets a naming scheme like `{n}/{s00e00}` organize files into
subfolders), the `--conflict` variants beyond skip (auto-number, override), and the
CLI flag surface itself.
7. **The rest of the UI** — the Rename panel (file loading, drag-drop, live preview,
local matching, confirmed rename) is built; the other five sidebar panels
(Episodes/Subtitles/SFV/Filter/List) are still stub screens, plus Align up/down
reordering, History, and Presets on the Rename panel itself are no-ops. There's also
no per-item exclude inside the rename confirmation modal yet (it's all-or-nothing —
use "Exclude Selected" on the file list beforehand to leave a file out entirely).
8. **Undo/history for renames** — there is no undo yet; the confirmation modal before
Rename executes is the only safety net right now. `net.filebot.HistoryDialog`/the
original's rename-history log is the reference for what a real undo would look like.
9. **Packaging** — code signing, auto-update, installers per platform via
`npm run tauri build`.