diff --git a/allstarr/Controllers/AdminController.cs b/allstarr/Controllers/AdminController.cs index bc3878b..073db61 100644 --- a/allstarr/Controllers/AdminController.cs +++ b/allstarr/Controllers/AdminController.cs @@ -607,7 +607,14 @@ public class AdminController : ControllerBase // If not local, check if it's externally matched or missing if (isLocal != true) { - if (matchedSpotifyIds.Contains(track.SpotifyId)) + // Check if there's a manual external mapping + if (isManualMapping && manualMappingType == "external") + { + // Track has manual external mapping - it's available externally + isLocal = false; + // externalProvider already set above + } + else if (matchedSpotifyIds.Contains(track.SpotifyId)) { // Track is externally matched (search succeeded) isLocal = false; diff --git a/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs b/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs index 24ca90f..dae7ddc 100644 --- a/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs +++ b/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs @@ -874,6 +874,7 @@ public class SpotifyTrackMatchingService : BackgroundService // Create a matched track entry for the external mapping var externalSong = new Song { + Id = $"ext-{provider}-song-{externalId}", // CRITICAL: Set proper ID format Title = spotifyTrack.Title, Artist = spotifyTrack.PrimaryArtist, Album = spotifyTrack.Album,