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:
+16
-7
@@ -14,6 +14,17 @@ templates = Jinja2Templates(directory="app/templates")
|
||||
# path is still available in the title attribute on hover).
|
||||
_LIBRARY_PREFIX = str(settings.music_data_dir / "Library") + "/"
|
||||
|
||||
# dedup-library.sh's four tag-based passes (numbered_sibling, case_insensitive,
|
||||
# normalized, cross_album_fuzzy) all match on filenames/tags; find-fuzzy-dupes.py's
|
||||
# one pass (fuzzy_audio) matches on acoustic fingerprint. The specific pass
|
||||
# name is an implementation detail -- the table just needs to say which of
|
||||
# the two matching methods caught it.
|
||||
_ACOUSTIC_PASS = "fuzzy_audio"
|
||||
|
||||
|
||||
def _pass_label(pass_name: str) -> str:
|
||||
return "Acoustically Similar" if pass_name == _ACOUSTIC_PASS else "File Naming"
|
||||
|
||||
|
||||
def _display_path(path: str) -> str:
|
||||
return path[len(_LIBRARY_PREFIX):] if path.startswith(_LIBRARY_PREFIX) else path
|
||||
@@ -23,6 +34,7 @@ def _to_row(c) -> dict:
|
||||
return {
|
||||
"id": c.id,
|
||||
"pass_name": c.pass_name,
|
||||
"pass_label": _pass_label(c.pass_name),
|
||||
"keep_path": c.keep_path,
|
||||
"delete_path": c.delete_path,
|
||||
"keep_display": _display_path(c.keep_path),
|
||||
@@ -42,13 +54,10 @@ async def dedup_index(request: Request, user: dict = Depends(require_auth)):
|
||||
|
||||
@router.post("/scan")
|
||||
async def scan(user: dict = Depends(require_auth)):
|
||||
await dedup_review_service.scan(triggered_by="manual")
|
||||
return RedirectResponse(url="/dedup", status_code=303)
|
||||
|
||||
|
||||
@router.post("/scan-fuzzy")
|
||||
async def scan_fuzzy(user: dict = Depends(require_auth)):
|
||||
await dedup_review_service.scan_fuzzy(triggered_by="manual")
|
||||
# Runs both the file-naming and acoustic passes -- see
|
||||
# dedup_review_service.scan_all(). The candidates table shows which
|
||||
# pass caught each one instead of needing two separate buttons.
|
||||
await dedup_review_service.scan_all(triggered_by="manual")
|
||||
return RedirectResponse(url="/dedup", status_code=303)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user