From 47b9427c201784f6f8b1a0804aa80997233e0c47 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Sat, 7 Feb 2026 12:05:55 -0500 Subject: [PATCH] fix: extract Spotify track ID from Odesli entityUniqueId format - Odesli returns entityUniqueId as 'SPOTIFY_SONG::trackid' - Now extracts just the track ID part after '::' - Fixes Spotify lyrics not working due to invalid ID format - Spotify lyrics service expects clean track IDs like '0PgYPBGqF6Wm5KFHQ81nq5' --- allstarr/Services/SquidWTF/SquidWTFMetadataService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/allstarr/Services/SquidWTF/SquidWTFMetadataService.cs b/allstarr/Services/SquidWTF/SquidWTFMetadataService.cs index 2b101ea..fecaacd 100644 --- a/allstarr/Services/SquidWTF/SquidWTFMetadataService.cs +++ b/allstarr/Services/SquidWTF/SquidWTFMetadataService.cs @@ -302,8 +302,15 @@ public class SquidWTFMetadataService : IMusicMetadataService platforms.TryGetProperty("spotify", out var spotifyPlatform) && spotifyPlatform.TryGetProperty("entityUniqueId", out var spotifyIdEl)) { - song.SpotifyId = spotifyIdEl.GetString(); - _logger.LogInformation("✓ Converted squidwtf/{ExternalId} → Spotify ID {SpotifyId}", externalId, song.SpotifyId); + var rawSpotifyId = spotifyIdEl.GetString(); + // Odesli returns format "SPOTIFY_SONG::trackid", extract just the track ID + if (!string.IsNullOrEmpty(rawSpotifyId)) + { + song.SpotifyId = rawSpotifyId.Contains("::") + ? rawSpotifyId.Split("::")[1] + : rawSpotifyId; + _logger.LogInformation("✓ Converted squidwtf/{ExternalId} → Spotify ID {SpotifyId}", externalId, song.SpotifyId); + } } } }