From 8d8c0892a2fa2c4a1e38e7519e1bb76761600fb9 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Fri, 30 Jan 2026 02:13:10 -0500 Subject: [PATCH] Fix: Handle decimal duration values from LRCLIB API LRCLIB returns duration as a decimal/float, not int. Convert to int using Math.Round. --- allstarr/Services/Lyrics/LrclibService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/allstarr/Services/Lyrics/LrclibService.cs b/allstarr/Services/Lyrics/LrclibService.cs index eac44b3..cc5e758 100644 --- a/allstarr/Services/Lyrics/LrclibService.cs +++ b/allstarr/Services/Lyrics/LrclibService.cs @@ -74,7 +74,7 @@ public class LrclibService TrackName = lyrics.TrackName ?? trackName, ArtistName = lyrics.ArtistName ?? artistName, AlbumName = lyrics.AlbumName ?? albumName, - Duration = lyrics.Duration, + Duration = (int)Math.Round(lyrics.Duration), Instrumental = lyrics.Instrumental, PlainLyrics = lyrics.PlainLyrics, SyncedLyrics = lyrics.SyncedLyrics @@ -131,7 +131,7 @@ public class LrclibService TrackName = lyrics.TrackName ?? trackName, ArtistName = lyrics.ArtistName ?? artistName, AlbumName = lyrics.AlbumName ?? albumName, - Duration = lyrics.Duration, + Duration = (int)Math.Round(lyrics.Duration), Instrumental = lyrics.Instrumental, PlainLyrics = lyrics.PlainLyrics, SyncedLyrics = lyrics.SyncedLyrics @@ -187,7 +187,7 @@ public class LrclibService TrackName = lyrics.TrackName ?? string.Empty, ArtistName = lyrics.ArtistName ?? string.Empty, AlbumName = lyrics.AlbumName ?? string.Empty, - Duration = lyrics.Duration, + Duration = (int)Math.Round(lyrics.Duration), Instrumental = lyrics.Instrumental, PlainLyrics = lyrics.PlainLyrics, SyncedLyrics = lyrics.SyncedLyrics @@ -216,7 +216,7 @@ public class LrclibService public string? TrackName { get; set; } public string? ArtistName { get; set; } public string? AlbumName { get; set; } - public int Duration { get; set; } + public double Duration { get; set; } public bool Instrumental { get; set; } public string? PlainLyrics { get; set; } public string? SyncedLyrics { get; set; }