Add Timeleft in track
This commit is contained in:
parent
7478741ba2
commit
0e2fa5f81a
@ -152,6 +152,15 @@ public class DisMediaRP : IDisposable
|
|||||||
string? shuffle = (playbackInfo.IsShuffleActive ?? false) ? "\ud83d\udd00" : null;
|
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}");
|
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);
|
this._discordRpcClient.SetPresence(this._currentStatus);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user