All four sources returning 0 results is a strong signal of a network
problem (DNS, firewall, proxy, Docker isolation) rather than four
independent matching bugs.
New endpoint GET /api/items/match/connectivity:
- Pings Google, MusicBrainz, OpenLibrary, GoogleBooks, DNB
- Returns per-target HTTP status, byte count, latency, error
- Surfaces any HTTP_PROXY / HTTPS_PROXY env vars that httpx would use
UI: New "Connectivity-Check" button in BookDetail. Result panel shows
each target green (HTTP 200) or red (error/timeout), so the user can
immediately see whether the backend has outbound internet access at
all, or whether it's a per-API issue.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DNB rewrite:
- Multiple query strategies with fallback (title+author+mat=ton →
title+author → title+mat=ton → title-only → fulltext). Returns on
first hit. Most German audiobooks aren't tagged mat=ton in DNB,
which was killing all searches.
- Strip CQL wildcard chars (?, *, <, >, =, /, quotes) from search
terms. The "???" in "Die drei ???" was breaking the CQL parser.
- Log HTTP status, body snippet on non-200, and numberOfRecords on
every query so log shows exactly what DNB returned.
- Parse SRU diagnostic elements (DNB error messages buried in XML).
- Convert author/narrator from "Lastname, Firstname" to
"Firstname Lastname" for consistency with other sources.
Matcher:
- Split series patterns: WITH_EPISODE (need digit) and SERIES_ONLY
(just the series name). "Die drei ??? und der Fluch des Rubins"
now properly detects "Die drei ???" as series even without folge#.
- New _build_search_title: removes ??? sequences, trailing parens,
collapses whitespace, before sending to APIs.
- Manual search also passes through normalization. Logs source +
hit count per query.
Debug endpoint:
- GET /api/items/match/debug?title=...&author=... returns raw results
from all 4 sources with status, error messages, and full metadata.
- "Debug" button added in BookDetail — shows what each API actually
returns inline, so the user can see if it's a search problem,
parse problem, or threshold problem.
- "Cover aus Datei" button — triggers local cover extraction
(folder.jpg or embedded artwork) on demand.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Streaming: Drop token-in-URL auth entirely. Session-ID (UUID, 128-bit
entropy) IS the auth — same approach as Audiobookshelf. Eliminates the
entire class of token-related failures and matches how every other
streaming server handles this. Logs every stream request with Range
header and User-Agent for diagnostics.
Player: Visible error banner in UI when audio fails (with HTML5 media
error code translated to German). Stream URL is shown in the banner so
the user can see exactly what failed.
Scanner: Cover extraction from two new sources (in addition to API
matching):
1. Folder-level images (cover.jpg, folder.jpg, front.jpg, etc.)
2. Embedded artwork (ID3 APIC, MP4 covr, FLAC/Vorbis pictures)
Runs on every scan — also fills in covers for items that were already
scanned but never got one from matching.
New endpoint POST /api/items/{id}/extract-cover triggers this manually
for a single item.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Streaming: Custom range-aware HTTP endpoint. Returns 206 Partial Content
for Range requests (with Content-Range, Content-Length, Accept-Ranges).
This was the root cause of broken seeking — Starlette's default
FileResponse behavior wasn't reliable across all clients. Now seeking
works natively via standard HTML5 audio.
Player: Full rewrite. Cleaner separation between absolute book time and
per-track time. Track switching uses pendingSeek + canplay/loadedmetadata
handlers. Console logs for debugging. Removed crossOrigin to avoid CORS
issues. Removed hls.js entirely.
Matcher: Critical bug fix — get_work_details (OpenLibrary) was returning
a sparse MatchResult that REPLACED the rich search result, losing cover,
author, year. New _enrich_match merges details into best without
overwriting existing values (except description/chapters which are
preferred from details fetch).
Scoring: Lenient min/max-weighted similarity (better for German episodic
titles like "Die drei ??? - Folge 215"). Thresholds lowered:
UNCERTAIN 0.50→0.40, AUTO_ACCEPT 0.75→0.65.
Search: search_for_item now returns ALL fields (narrator, publisher,
series, genres, description, language) so manual apply has full data.
Apply: apply_match now always constructs from body first, then enriches
with details. Previously OL applies would lose cover/author. Added
detailed logging across matcher and apply paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>