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