Restructure Settings nav, modernize import page, dedup/genres UX polish

Settings is now one top-nav entry with Credentials and Jobs as sidebar
sub-pages (jobs moved from /jobs to /settings/jobs). Manual import page
replaces the bare file input and free-text filename field with a drag-drop
dropzone and a proper file-picker table. Genres page drops the "force"
checkbox for two explicit buttons (Preview / Fix genres now). Dedup's
"Scan now" runs both the file-naming and acoustic passes together, and the
table labels which pass caught each candidate instead of showing the raw
pass name. .btn-ghost gets a visible border so it reads as a real button
next to Delete/Danger actions instead of looking unaligned. Job names
throughout the UI are now human-readable instead of raw job_key strings.

Also includes the fpcalc exit-code fix from earlier (fingerprint index
was discarding valid fingerprints on files with a benign decode warning).
This commit is contained in:
andrew
2026-07-09 10:26:40 -06:00
parent 1f733d6e91
commit b4dd2286a9
18 changed files with 315 additions and 108 deletions
+9
View File
@@ -119,6 +119,15 @@ async def scan_fuzzy(triggered_by: str = "manual") -> DedupRun:
return await _run_scan("dedup:scan_fuzzy", _FUZZY_SCRIPT, triggered_by)
async def scan_all(triggered_by: str = "manual") -> tuple[DedupRun, DedupRun]:
"""Run both passes back to back for a single "Scan now" click -- each
call acquires and releases the shared pipeline lock on its own, so
running them sequentially here is safe, just one after the other."""
tag_run = await scan(triggered_by=triggered_by)
fuzzy_run = await scan_fuzzy(triggered_by=triggered_by)
return tag_run, fuzzy_run
def _write_apply_args(script_name: str, script: str, group: list[DedupCandidate], stamp: int) -> list[str]:
"""Build the --apply invocation for one pass's confirmed group.
+49
View File
@@ -178,6 +178,55 @@ MAINTENANCE_JOB_DESCRIPTIONS: dict[str, str] = {
"maintenance:upgrade_mp3_to_flac": "Look for FLAC replacements for MP3 tracks (monthly).",
}
# Display-only friendly names -- never used as the actual scheduler/DB
# identifier (job_key stays as-is everywhere else), just what the UI shows
# instead of a raw "maintenance:snake_case_key". Every job_key not listed
# here (e.g. playlist:<name>, one per playlist) falls back to
# humanize_job_key()'s generic cleanup below.
JOB_LABELS: dict[str, str] = {
"maintenance:sync_bandcamp": "Sync Bandcamp",
"maintenance:normalize_casing": "Normalize artist casing",
"maintenance:dedup": "Dedup scan",
"maintenance:gen_djmix_playlist": "Rebuild DJ-mix playlist",
"maintenance:gen_vgm_playlist": "Rebuild game-soundtrack playlist",
"maintenance:navidrome_scan": "Navidrome rescan",
"maintenance:export_laptop_playlists": "Export laptop playlists",
"maintenance:enrich_buy_url": "Look up buy links",
"maintenance:build_fingerprint_index": "Rebuild fingerprint index",
"maintenance:pipeline_status_report": "Daily status report",
"maintenance:log_rotation": "Rotate old logs",
"maintenance:strip_mb_tags": "Strip MusicBrainz tags",
"maintenance:strip_watermark_art": "Remove watermark art",
"maintenance:scrub_watermark_text": "Remove watermark text",
"maintenance:clean_sldl_index": "Clean download index",
"maintenance:clear_bad_genres": "Clear bad genre tags",
"maintenance:spotify_genre": "Refill genres from Spotify",
"maintenance:beets_update_sync": "Sync library tags",
"maintenance:upgrade_mp3_to_flac": "Upgrade MP3s to FLAC",
"dedup:scan": "Dedup scan (file naming)",
"dedup:scan_fuzzy": "Dedup scan (audio)",
"dedup:apply": "Dedup: delete confirmed",
"genre:run": "Genre refresh",
"manual:import": "Manual import",
"manual:fix_genre": "Fix genre",
"manual:navidrome_scan_after_edit": "Navidrome rescan (after edit)",
"manual:retag_from_url": "Retag from URL",
}
def humanize_job_key(job_key: str) -> str:
"""Friendly label for a job_key, for display only. Falls back to a
cleaned-up version of the key for anything not in JOB_LABELS -- covers
playlist:<name>, one per playlist, and anything added later without
needing a JOB_LABELS entry."""
if job_key in JOB_LABELS:
return JOB_LABELS[job_key]
if job_key.startswith("playlist:"):
return f"Playlist sync: {job_key.split(':', 1)[1]}"
_prefix, _, rest = job_key.partition(":")
rest = rest.replace("_", " ").strip()
return (rest[:1].upper() + rest[1:]) if rest else job_key
# Module-level singleton so other services (playlist_service, future
# routers) can reach the live scheduler without main.py threading it through