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); + } } } }