feat(quarantine): show real audio quality in the review UI + path-resolve diag
- list_quarantine_entries now surfaces the probed quality (context._audio_quality, recorded before the gates) so each quarantine row shows what the file actually is when deciding to approve/delete. Rendered as a quality chip in the review UI. - _resolve_library_file_path logs the searched base dirs once when it can't resolve a path, so a remaining mount/path mismatch is diagnosable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8a22b3f8ba
commit
cf8f562e61
3 changed files with 19 additions and 0 deletions
|
|
@ -220,6 +220,10 @@ def list_quarantine_entries(quarantine_dir: str) -> List[Dict[str, Any]]:
|
|||
"source_username": source_username,
|
||||
"source_filename": source_filename,
|
||||
"thumb_url": _extract_context_thumb(ctx),
|
||||
# Real probed audio quality (recorded on the context before the
|
||||
# quality/AcoustID gates) so the review UI shows what the file
|
||||
# actually is when deciding to approve/delete.
|
||||
"quality": ctx.get("_audio_quality", "") if isinstance(ctx, dict) else "",
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -11749,6 +11749,9 @@ def _sync_tracks_to_server(track_rows, server_type):
|
|||
return result
|
||||
|
||||
|
||||
_resolve_library_diag_logged = False
|
||||
|
||||
|
||||
def _resolve_library_file_path(file_path):
|
||||
"""Resolve a library file path to an actual file on disk."""
|
||||
if not file_path:
|
||||
|
|
@ -11806,6 +11809,17 @@ def _resolve_library_file_path(file_path):
|
|||
if found:
|
||||
return found
|
||||
|
||||
# Couldn't resolve — log the bases we searched ONCE so a path/mount mismatch
|
||||
# is diagnosable (e.g. files live under a dir that isn't transfer/download/
|
||||
# a configured library path).
|
||||
global _resolve_library_diag_logged
|
||||
if not _resolve_library_diag_logged:
|
||||
_resolve_library_diag_logged = True
|
||||
logger.warning(
|
||||
"[PathResolve] Could not resolve %r under any base dir — searched transfer=%r "
|
||||
"download=%r library=%r. If files live elsewhere, add it under Settings > Library music paths.",
|
||||
file_path, transfer_dir, download_dir, sorted(library_dirs),
|
||||
)
|
||||
return None
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2689,6 +2689,7 @@ function _verifQuarRows() {
|
|||
</div>
|
||||
<div class="verif-actions" onclick="event.stopPropagation()">
|
||||
<span class="verif-reason-badge ${trigClass}" title="${_adlEsc(q.reason || '')}">${trigLabel}</span>
|
||||
${q.quality ? `<span class="adl-quality-chip" title="Audio quality of the quarantined file (read from the file itself)">${_adlEsc(q.quality)}</span>` : ''}
|
||||
${timeAgo ? `<span class="verif-time">${timeAgo}</span>` : ''}
|
||||
<button class="verif-act verif-act-play" onclick="verifQuarPlay(${idx})" title="Play the quarantined file in the media player">▶</button>
|
||||
<button class="verif-act" onclick="verifQuarCompare(${idx}, this)" title="Find the expected track on Soulseek/streaming sources and play it in the media player — compare against the quarantined file">⇆</button>
|
||||
|
|
|
|||
Loading…
Reference in a new issue