Fix the issue

This commit is contained in:
Diamond Creeper 2024-12-02 21:43:00 +13:00
parent 7fad3c7b63
commit 2a2689bfb7
2 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View file

@ -54,3 +54,4 @@ ehthumbs.db
# ASP.NET Core web app
wwwroot/
*.cache

View file

@ -58,7 +58,6 @@ class Program
await updateTask; // Wait for the rich presence update task to finish
}
private static async Task UpdateRichPresence()
{
while (true)
@ -98,7 +97,7 @@ class Program
Timestamps = new Timestamps
{
Start = DateTime.UtcNow - playingInfo.Progress,
End = playingInfo.EndDate
End = DateTime.UtcNow + (playingInfo.Duration - playingInfo.Progress)
},
Assets = new Assets
{
@ -214,7 +213,7 @@ class Program
Duration = TimeSpan.FromTicks((long)nowPlaying["RunTimeTicks"]),
IsMusic = isMusic,
NowPlayingItem = nowPlaying,
EndDate = new DateTime((long)nowPlaying["RunTimeTicks"])
EndDate = DateTime.UtcNow + TimeSpan.FromTicks((long)nowPlaying["RunTimeTicks"]) // Calculating end date based on duration
};
}
}