mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 07:58:39 -05:00
Fix: Manual external mappings now properly included in playlist cache
The bug was in PreBuildPlaylistItemsCacheAsync - when a manual external mapping was found, it was added to matchedTracks but the code used 'continue' to skip to the next track WITHOUT adding it to finalItems. This meant external manual mappings were never included in the playlist cache that gets served to clients. The fix converts the external song to Jellyfin item format and adds it to finalItems before continuing, ensuring manual external mappings are properly included in the pre-built playlist cache.
This commit is contained in:
@@ -884,12 +884,19 @@ public class SpotifyTrackMatchingService : BackgroundService
|
||||
ExternalId = externalId
|
||||
};
|
||||
|
||||
matchedTracks.Add(new MatchedTrack
|
||||
var matchedTrack = new MatchedTrack
|
||||
{
|
||||
Position = spotifyTrack.Position,
|
||||
SpotifyId = spotifyTrack.SpotifyId,
|
||||
MatchedSong = externalSong
|
||||
});
|
||||
};
|
||||
|
||||
matchedTracks.Add(matchedTrack);
|
||||
|
||||
// Convert external song to Jellyfin item format and add to finalItems
|
||||
var externalItem = responseBuilder.ConvertSongToJellyfinItem(externalSong);
|
||||
finalItems.Add(externalItem);
|
||||
externalUsedCount++;
|
||||
|
||||
_logger.LogInformation("✓ Using manual external mapping for {Title}: {Provider} {ExternalId}",
|
||||
spotifyTrack.Title, provider, externalId);
|
||||
|
||||
Reference in New Issue
Block a user