From 9318998f9a1eb9b87aab4b3dcf4cc8572bb01776 Mon Sep 17 00:00:00 2001 From: Kevin Heneveld <1192102+kevinheneveld@users.noreply.github.com> Date: Tue, 14 Jul 2026 10:53:40 -0800 Subject: [PATCH] fix(metadata): treat Audible's empty product stub as no answer so the provider chain can continue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An ASIN missing from Audible's catalog resolves to a non-null but EMPTY AudibleBookResponse (no title, no fields — the catalog API returns a product node with every attribute null). The provider loop took that shell as a successful answer: the caller received junk metadata ('source: Audible' with nothing in it) and every later source in the chain (Audnexus, anything added in future) was silently skipped. Live case: an Amazon-exclusive edition whose ASIN returns the empty stub from all ten regional Audible catalogs — 'fill missing from online' reported success while filling nothing. A titleless response is now treated as no answer and the chain falls through. Co-Authored-By: Claude Fable 5 --- .../Metadata/Core/AudiobookMetadataService.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/listenarr.application/Metadata/Core/AudiobookMetadataService.cs b/listenarr.application/Metadata/Core/AudiobookMetadataService.cs index 3181f7e1f..97bf0310b 100644 --- a/listenarr.application/Metadata/Core/AudiobookMetadataService.cs +++ b/listenarr.application/Metadata/Core/AudiobookMetadataService.cs @@ -115,6 +115,18 @@ public AudiobookMetadataService( continue; } + // An ASIN missing from Audible's catalog comes back as a + // non-null but EMPTY product stub (no title, no fields). + // Treating that as an answer both returns junk to the + // caller and blocks every later source in the chain. + if (result is AudibleBookResponse shell && string.IsNullOrWhiteSpace(shell.Title)) + { + _logger.LogInformation( + "{SourceName} returned an empty product stub for ASIN {Asin}; treating as no answer", + source.Name, asin); + result = null; + } + if (result != null) { _logger.LogInformation("Successfully fetched metadata from {SourceName} for ASIN: {Asin}", source.Name, asin);