Fix manual mapping detection in Active Playlists tab
Some checks failed
CI / build-and-test (push) Has been cancelled

This commit is contained in:
2026-02-04 19:35:34 -05:00
parent d11b656b23
commit 8fad6d8c4e
2 changed files with 67 additions and 4 deletions

View File

@@ -494,8 +494,20 @@ public class AdminController : ControllerBase
{
var isLocal = false;
if (localTracks.Count > 0)
// FIRST: Check for manual mapping (same as SpotifyTrackMatchingService)
var manualMappingKey = $"spotify:manual-map:{decodedName}:{track.SpotifyId}";
var manualJellyfinId = await _cache.GetAsync<string>(manualMappingKey);
if (!string.IsNullOrEmpty(manualJellyfinId))
{
// Manual mapping exists - this track is definitely local
isLocal = true;
_logger.LogDebug("✓ Manual mapping found for {Title}: Jellyfin ID {Id}",
track.Title, manualJellyfinId);
}
else if (localTracks.Count > 0)
{
// SECOND: No manual mapping, try fuzzy matching
var bestMatch = localTracks
.Select(local => new
{