Add organizing files into Artist/Album/01 Title from their tags

A new Organize tab renames audio files from their tags into a per-pair
naming pattern, by default {artist}/{album}/{track} {title} (album
artist, falling back to artist). Multi-disc albums get a disc prefix
(2-04) or a Disc N folder; names are made safe for Windows/SMB shares.

- Preview first: every rename, files already organized, and files
  skipped with the reason (missing tags, with a button into the tag
  editor; two files resolving to the same name; an existing file).
- Applying re-checks each file against the preview, moves it within its
  library (hardlinks and contents untouched, case-only renames via a
  temporary name, completed on startup after a crash), carries .lrc
  lyrics and folder cover art along, and removes emptied folders. Each
  move is an operation that can be undone; the library is rescanned.
- Optional automatic organizing of the slave, master or both during
  scans (off by default). Dry run applies.
- Scans now recognise a slave file that is a hardlink of a master file
  at a different path as linked ("same file, other path") instead of
  unmatched.

Migration 7 adds the per-pair naming settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cdnutterandClaude Opus 5.5 committed 2026-09-29 12:23:41 -07:00
1 parent 3eb02e2c8d
commit dbcf562f7e
16 files changed
+1480 -11

No files matched your search

+28 -3
View File
@@ -76,6 +76,9 @@ export type Pair = {
settle_minutes: number;
approx_matching: boolean;
approx_threshold: number;
organize_template: string;
organize_multidisc: "prefix" | "folder" | "none";
auto_organize: "off" | "slave" | "master" | "both";
last_scan_at: number | null;
last_scan_error: string;
last_scan_warnings: ScanWarning[];
@@ -96,6 +99,9 @@ export type PairInput = Pick<
| "settle_minutes"
| "approx_matching"
| "approx_threshold"
| "organize_template"
| "organize_multidisc"
| "auto_organize"
>;
export type ProbeInfo = {
@@ -123,7 +129,7 @@ export type Match = {
pair_id: number;
rel_slave: string;
rel_master: string;
kind: "path" | "path_case" | "extension" | "fuzzy" | "elsewhere" | "approximate" | "none";
kind: "path" | "path_case" | "extension" | "fuzzy" | "elsewhere" | "approximate" | "inode" | "none";
status: Status;
master_size: number;
master_mtime: number;
@@ -141,7 +147,7 @@ export type Match = {
export type Operation = {
id: number;
pair_id: number;
action: "link" | "promote" | "build" | "remove" | "rename" | "tags";
action: "link" | "promote" | "build" | "remove" | "rename" | "tags" | "move";
rel_master: string;
rel_slave: string;
rel_new: string;
@@ -156,7 +162,13 @@ export type Operation = {
finished_at: number | null;
undone_at: number | null;
purged_at: number | null;
detail?: { side?: "master" | "slave"; mode?: "replace" | "inplace"; changes?: Record<string, [string, string]> };
detail?: {
side?: "master" | "slave";
mode?: "replace" | "inplace";
changes?: Record<string, [string, string]>;
sidecars?: [string, string][];
art?: boolean;
};
};
export type TreeEntry = {
@@ -228,3 +240,16 @@ export type TagFile = {
links: number;
size: number;
};
export type OrganizeItem = { id: number; side: Side; from: string; to?: string; move: boolean; reason?: string; sidecars?: string[] };
export type OrganizePlan = {
pair_id: number;
sides: Side[];
template: string;
created_at: number;
scanned: number;
conforming: number;
moves: number;
skips: Record<string, number>;
};