Library Cleanup — preview-first mockup
Phase 1 only: deterministic transforms + junk-strip on names that already have resolution data, or have garbage trailing tokens. No ffprobe. No resolution-adding work. Real numbers from the 2026-05-26 Library Issues export.
1 — Volume picture
Already clean
No work needed.
- 0 bracket_id
- 0 nohyphen_id
Cleanup-tier (Phase 1a)
Already have resolution data. Just reshape.
- 64 resolution_part_suffix —
RBD-394 [1080p].2of2.wmv - 18 resolution_copy_suffix —
PIYO-005 [1080p] (1).mp4 - 3 resolution_bare_suffix —
REAL-487.450p.wmv - → 85 become fully canonical after Phase 1a
Junk-strip (Phase 1b)
Strip leftover tags. Still missing resolution after.
- 2 empty brackets
[] - 5
.HDsuffix (failed auto-label) - 6
[396m]bracket (bitrate, not resolution) - ~9
_PARTN→ optional normalize - → ~21 renamed, still need Phase 2 ffprobe later
The other 775 missing_resolution files (bare names like ROYD-109.mp4) need resolution data we don't have on hand. Out of scope for this cleanup session.
2 — Preview flow options (P1 / P2 / P3)
P1 — Inline rows in existing Library Issues modal
Add Old → New column to existing rows. Same modal. New "Cleanup Plan" filter chip on top of existing All / Found / Missing chips.
P2 — Dedicated Cleanup Plan modal recommended
Click "Generate Cleanup Plan" in Library Review. Opens its own modal with only the ~106 affected files, grouped by transform kind. Per-group select-all, per-row toggle, Apply N button at bottom.
P3 — External JSON plan + reimport
Export cleanup-plan-{ts}.json. User edits in text editor (deletes lines to skip). Re-import to apply.
3 — Mockup: P2 Cleanup Plan modal
Below shows what the dedicated modal looks like for your actual library state. Grouped by transform kind. Per-row checkbox. Conflict rows default-unchecked + flagged.
4 — Per-row anatomy
full_path in tooltipconflict or still missing res stack vertically5 — Conflict cases
Cache-based conflict detection runs synchronously when building the plan. Real rclone-side recheck runs at apply time as belt-and-suspenders.
| Conflict case | Example | Plan default |
|---|---|---|
| Target exists in cache | PIYO-005 [1080p] (1).mp4 → PIYO-005 [1080p].mp4stripped form already in cache.json |
skip Default-unchecked. Reason text: "Use Duplicate Review to decide which to keep." |
| Two plan rows target same new name | If ABC-001 (1).mp4 AND ABC-001 (2).mp4 both want ABC-001.mp4 |
skip both Plan generator detects in-plan collision; flags both rows with "conflict-with-plan-row N." |
| Target appears at apply time | File renamed externally between plan generation and Apply click | apply-time skip rclone lsf check fails; row reported as skipped: target appeared in summary modal. |
| rclone moveto error | Network glitch, permission, rclone bug | apply-time fail Row marked failed in summary. Other renames continue. User can re-run plan to retry. |
6 — Apply progress + summary
Bulk apply on ~104 files is roughly 1-2 minutes at typical rclone moveto latency. Progress + cancel needed.
Cancel waits for the current rclone moveto to complete before stopping. Partial application is safe — cache is patched per-rename, batch save_cache still fires at the end of the cancelled run.
Result summary modal (after apply)
7 — Ignore list (optional, per-file)
After applying, some files might intentionally stay non-canonical. Tracking them prevents Library Issues from re-flagging the same file next scan. Per-file flag in cache, no UI editor needed beyond a "Mark as intentional" checkbox per row in the modal.
filename_hygiene_ignore: true to cache entry when row is unchecked + marked Intentional. Library Issues scan skips these files going forward. Cleared on cache rebuild.8 — Decisions to lock before any code
| Decision | Options | Suggested default |
|---|---|---|
| Preview flow | P1 inline · P2 dedicated modal · P3 JSON-only | P2 + P3 export as side button |
| Part-suffix canonical shape | #part2 [1080p] · [1080p] #part2 · .2of2 [1080p] · leave alone |
#part2 [1080p]resolution at end matches the canonical regex; #partN matches existing extract_id convention |
| _PARTN normalization (9 files) | Convert _PART1 → #part1 · Leave as-is |
Optional group, default deselected extract_id already handles both; cosmetic only |
| copy_suffix conflict policy | Auto-skip + report · Auto-include + warn · User decides per-row | Auto-skip + default-uncheck prevents clobbering real dupes; user can override |
| Multi-pattern transforms | Composite single row · Sequential per pattern | Composite simpler review; reason field lists all applied transforms |
| Revert plan artifact | None · Auto-save JSON · Save on user opt-in | Auto-save to disk on apply cheap safety net; user can ignore if not needed |
| Progress UI during apply | None · Spinner · Full progress bar + ETA | Full bar + ETA + cancel apply takes 1-2 min; user needs visibility |
| Placement in extension | Library Review pane (add button) · New Setup card · Detached window | Library Review pane already where users go for library issues |
| Persistent ignore list | None · Per-file flag in cache · Pattern-based regex | Per-file flag simplest; cleared on cache rebuild is acceptable |
9 — What's NOT in this mockup (scope-fenced)
- ffprobe / resolution probing — Phase 2, separate mockup if/when needed
- Bare-name renames (~775 missing_resolution files) — out of scope without resolution data
- Quality-mapping editor (HD → 1080p config) — only 4 files affected; not worth own UI
- Bulk cancellation that aborts mid-rclone-call — would risk corrupt remote state; not supported
- Cross-remote moves — cleanup keeps files in same folder; only rename within remote
- Pattern-rule editor — extends Library Issues custom_rules; future enhancement