1
0

Add Timeleft in track

This commit is contained in:
glax 2024-02-22 08:33:46 +01:00
parent 7478741ba2
commit 0e2fa5f81a

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);
}