1
0

Compare commits

..

2 Commits

Author SHA1 Message Date
0e2fa5f81a Add Timeleft in track 2024-02-22 08:33:46 +01:00
7478741ba2 nullReference 2024-02-22 05:54:41 +01:00
2 changed files with 10 additions and 1 deletions

View File

@ -152,6 +152,15 @@ public class DisMediaRP : IDisposable
string? shuffle = (playbackInfo.IsShuffleActive ?? false) ? "\ud83d\udd00" : null;
this._currentStatus.State = string.Join(' ', repeatMode, shuffle, $"{timelineProperties.Position:hh\\:mm\\:ss}/{timelineProperties.EndTime:hh\\:mm\\:ss}");
if (mediaSession.ControlSession.GetPlaybackInfo().PlaybackStatus is
GlobalSystemMediaTransportControlsSessionPlaybackStatus.Playing)
this._currentStatus.Timestamps = new Timestamps()
{
End = DateTime.UtcNow.Add(timelineProperties.EndTime - timelineProperties.Position)
};
else
this._currentStatus.Timestamps = new Timestamps();
this._discordRpcClient.SetPresence(this._currentStatus);
}

View File

@ -22,7 +22,7 @@ else
throw new ArgumentNullException(nameof(discordKey));
int imageKeyIndex = Array.IndexOf(args, "-i");
string? imageKey = null;
string imageKey = "cat";
if(imageKeyIndex > -1)
if (imageKeyIndex + 1 < args.Length)
imageKey = args[imageKeyIndex + 1];