From 526a079368cb85748469f0a79b5fe53e11f7a5cc Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Wed, 4 Feb 2026 15:40:52 -0500 Subject: [PATCH] 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 --- allstarr/Controllers/JellyfinController.cs | 2 +- allstarr/Services/Spotify/SpotifyTrackMatchingService.cs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index 118120a..a4c2138 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -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); } } } diff --git a/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs b/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs index 93e2734..14f6a0d 100644 --- a/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs +++ b/allstarr/Services/Spotify/SpotifyTrackMatchingService.cs @@ -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);