Fix compilation errors and nullability warnings

- Fixed LrclibService.GetLyricsAsync call to use empty string and 0 for duration
- Fixed nullability warnings in SpotifyTrackMatchingService by explicitly casting to nullable tuple
This commit is contained in:
2026-02-04 15:40:52 -05:00
parent 7a7b884af2
commit 526a079368
2 changed files with 6 additions and 5 deletions

View File

@@ -343,7 +343,7 @@ public class JellyfinController : ControllerBase
if (!string.IsNullOrEmpty(title) && !string.IsNullOrEmpty(artist))
{
await _lrclibService.GetLyricsAsync(title, artist, null, null);
await _lrclibService.GetLyricsAsync(title, artist, "", 0);
}
}
}

View File

@@ -365,20 +365,20 @@ public class SpotifyTrackMatchingService : BackgroundService
spotifyTrack.Position, spotifyTrack.Title, spotifyTrack.PrimaryArtist,
matchType, matchedSong.Title);
return (matched, matchType);
return ((MatchedTrack?)matched, matchType);
}
else
{
_logger.LogDebug(" #{Position} {Title} - {Artist} → no match",
spotifyTrack.Position, spotifyTrack.Title, spotifyTrack.PrimaryArtist);
return (null, "none");
return ((MatchedTrack?)null, "none");
}
}
catch (Exception ex)
{
_logger.LogDebug(ex, "Failed to match track: {Title} - {Artist}",
spotifyTrack.Title, spotifyTrack.PrimaryArtist);
return (null, "none");
return ((MatchedTrack?)null, "none");
}
}).ToList();
@@ -386,8 +386,9 @@ public class SpotifyTrackMatchingService : BackgroundService
var batchResults = await Task.WhenAll(batchTasks);
// Collect results
foreach (var (matched, matchType) in batchResults)
foreach (var result in batchResults)
{
var (matched, matchType) = result;
if (matched != null)
{
matchedTracks.Add(matched);