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.

Scope locked: Phase 1 cleanup only. Phase 2 resolution probing is a separate session. Goal here: 85 cleanup-tier renames + ~21 junk-strips on missing-resolution names. Total in scope: ~106 files. Preview is mandatory before any rclone moveto runs.

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_suffixRBD-394 [1080p].2of2.wmv
  • 18 resolution_copy_suffixPIYO-005 [1080p] (1).mp4
  • 3 resolution_bare_suffixREAL-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 .HD suffix (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.

Trade: no new surface, but modal is busy. 779 missing_resolution rows are already cramped; adding 106 cleanup rows compounds it.

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.

Trade: focused UX, but a new modal to maintain. Mockup below uses this.

P3 — External JSON plan + reimport

Export cleanup-plan-{ts}.json. User edits in text editor (deletes lines to skip). Re-import to apply.

Trade: full audit trail + offline review, but high friction. Worth offering as a secondary "Export plan" button alongside P2.

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

One row, annotated
Five columns: checkbox · old name + folder context · arrow · new name · transform tag + size
RBD-394 [1080p].2of2.wmv cq:JAV/Q-U/R/RBD/
RBD-394 #part2 [1080p].wmv
transform 2.63 GiB
checkbox — default checked unless conflict detected; per-row toggle, per-group select-all
old name + remote folder — folder context is muted so it stays scannable; full full_path in tooltip
arrow — separator only, no interactivity
new name — green text on safe transforms, red on conflicts
meta — transform-kind tag + file size; flags like conflict or still missing res stack vertically

5 — 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 caseExamplePlan default
Target exists in cache PIYO-005 [1080p] (1).mp4PIYO-005 [1080p].mp4
stripped 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.

Applying renames…
Progress channel mirrors the existing scan-progress pattern
Renaming NFDM-247 [720p].1of2.wmv 43 / 104
41 succeeded · 2 conflicts (skipped) · 0 failed elapsed 22s · est 32s remaining

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)

Cleanup complete
104 of 106 renames attempted · 102 succeeded · 2 conflicts auto-skipped
102
succeeded
2
conflicts (in-plan skip)
0
apply-time failures
~21
still need resolution (Phase 2)
Cache patched + saved · scan re-suggests cleanup pass if any items remain

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.

Adds 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

DecisionOptionsSuggested 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)