Fix displaying movie status

Removed showing "Season N/A, Episode N/A" when watching a movie
This commit is contained in:
Diamond Creeper 2024-11-30 22:51:14 +13:00
parent 52ab4c6398
commit b1cbe1988d
6 changed files with 9 additions and 5 deletions

View file

@ -56,18 +56,22 @@ class Program
string details = playingInfo.IsMusic
? $"{playingInfo.Title}" // Show song name
: $"Watching: {nowPlaying["SeriesName"]?.ToString() ?? "Unknown Series"} - {playingInfo.Title}"; // Show series and episode name
: nowPlaying["SeriesName"] != null
? $"Watching: {nowPlaying["SeriesName"]} - {playingInfo.Title}" // Show series and episode name
: $"Watching: {playingInfo.Title}"; // For movies, show only the title
string state = playingInfo.IsMusic
? $"{playingInfo.Artist}" // Show artist name
: $"Season {playingInfo.Season}, Episode {playingInfo.Episode}";
: nowPlaying["SeriesName"] != null
? $"Season {playingInfo.Season}, Episode {playingInfo.Episode}" // Show season and episode for series
: ""; // Leave state empty for movies
Console.WriteLine($"Updating presence with details: {details}, state: {state}");
_discordClient.SetPresence(new RichPresence
{
Details = details,
State = state,
State = string.IsNullOrWhiteSpace(state) ? null : state, // Avoid sending empty state to Discord
Timestamps = new Timestamps
{
Start = DateTime.UtcNow - playingInfo.Progress,