From c44e48a4256a8c44f639eb2183f4126b6506f50e Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Sat, 7 Feb 2026 11:21:03 -0500 Subject: [PATCH] add debug logging to track provider identification --- allstarr/Controllers/AdminController.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/allstarr/Controllers/AdminController.cs b/allstarr/Controllers/AdminController.cs index fd44443..f16ee72 100644 --- a/allstarr/Controllers/AdminController.cs +++ b/allstarr/Controllers/AdminController.cs @@ -684,33 +684,51 @@ public class AdminController : ControllerBase if (providerIds != null) { - // Check for external provider keys + _logger.LogDebug("Track {Title} has ProviderIds: {Keys}", track.Title, string.Join(", ", providerIds.Keys)); + + // Check for external provider keys FIRST if (providerIds.ContainsKey("SquidWTF")) { isLocal = false; externalProvider = "SquidWTF"; + _logger.LogDebug("✓ Track {Title} identified as SquidWTF", track.Title); } else if (providerIds.ContainsKey("Deezer")) { isLocal = false; externalProvider = "Deezer"; + _logger.LogDebug("✓ Track {Title} identified as Deezer", track.Title); } else if (providerIds.ContainsKey("Qobuz")) { isLocal = false; externalProvider = "Qobuz"; + _logger.LogDebug("✓ Track {Title} identified as Qobuz", track.Title); } else if (providerIds.ContainsKey("Tidal")) { isLocal = false; externalProvider = "Tidal"; + _logger.LogDebug("✓ Track {Title} identified as Tidal", track.Title); } else { - // No external provider - it's local + // No external provider key found - it's a local track + // Local tracks have MusicBrainz, ISRC, Spotify IDs but no external provider isLocal = true; + _logger.LogDebug("✓ Track {Title} identified as LOCAL (has ProviderIds but no external provider)", track.Title); } } + else + { + _logger.LogWarning("Track {Title} has ProviderIds object but it's null after parsing", track.Title); + } + } + else + { + _logger.LogWarning("Track {Title} in cache but has NO ProviderIds - treating as missing", track.Title); + isLocal = null; + externalProvider = null; } // Check if this is a manual mapping