mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user