Fix matching: add missing subtitle field, proper error logging, match-all endpoint
- MatchResult was missing subtitle field, causing AttributeError in _apply_match that silently killed every background match task - Wrap _apply_match in try/except with exc_info logging so failures are visible in docker compose logs backend - New POST /api/libraries/:id/match-all endpoint to trigger matching for all unlocked items (useful for items scanned before the fix) - Admin UI: Match button per library next to the Scan button Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -233,12 +233,15 @@ async def match_audiobook(item_id: str):
|
||||
logger.warning(f"{source_name} Fehler: {e}")
|
||||
|
||||
if best and best_score >= UNCERTAIN_THRESHOLD:
|
||||
await _apply_match(db, item, best, best_score)
|
||||
logger.info(f"Match angewendet: '{item.title}' ← {best.source} ({best_score:.2f})")
|
||||
try:
|
||||
await _apply_match(db, item, best, best_score)
|
||||
await db.commit()
|
||||
logger.info(f"Match angewendet: '{item.title}' ← {best.source} ({best_score:.2f})")
|
||||
except Exception as e:
|
||||
logger.error(f"_apply_match fehlgeschlagen für '{title}': {e}", exc_info=True)
|
||||
else:
|
||||
logger.info(f"Kein Match für '{title}' (beste Konfidenz: {best_score:.2f})")
|
||||
|
||||
await db.commit()
|
||||
await db.commit()
|
||||
|
||||
|
||||
async def search_for_item(title: str, author: str | None = None) -> list[dict]:
|
||||
|
||||
@@ -7,6 +7,7 @@ class MatchResult:
|
||||
source: str # musicbrainz / open_library / google_books
|
||||
source_id: str
|
||||
title: str
|
||||
subtitle: str | None = None
|
||||
author: str | None = None
|
||||
narrator: str | None = None
|
||||
description: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user