From c7e53bce2fa43ad38807a0589e1bc020237e49c6 Mon Sep 17 00:00:00 2001 From: Ionut Andrei Oanca Date: Sun, 15 Nov 2020 17:03:27 +0100 Subject: Patch data-races and minor changes in SyncPlay --- Jellyfin.Api/Controllers/TimeSyncController.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'Jellyfin.Api/Controllers/TimeSyncController.cs') diff --git a/Jellyfin.Api/Controllers/TimeSyncController.cs b/Jellyfin.Api/Controllers/TimeSyncController.cs index 2dc744e7c..5de560417 100644 --- a/Jellyfin.Api/Controllers/TimeSyncController.cs +++ b/Jellyfin.Api/Controllers/TimeSyncController.cs @@ -13,7 +13,7 @@ namespace Jellyfin.Api.Controllers public class TimeSyncController : BaseJellyfinApiController { /// - /// Gets the current utc time. + /// Gets the current UTC time. /// /// Time returned. /// An to sync the client and server time. @@ -22,18 +22,14 @@ namespace Jellyfin.Api.Controllers public ActionResult GetUtcTime() { // Important to keep the following line at the beginning - var requestReceptionTime = DateTime.UtcNow.ToUniversalTime().ToString("o", DateTimeFormatInfo.InvariantInfo); + var requestReceptionTime = DateTime.UtcNow.ToUniversalTime(); - var response = new UtcTimeResponse(); - response.RequestReceptionTime = requestReceptionTime; - - // Important to keep the following two lines at the end - var responseTransmissionTime = DateTime.UtcNow.ToUniversalTime().ToString("o", DateTimeFormatInfo.InvariantInfo); - response.ResponseTransmissionTime = responseTransmissionTime; + // Important to keep the following line at the end + var responseTransmissionTime = DateTime.UtcNow.ToUniversalTime(); // Implementing NTP on such a high level results in this useless // information being sent. On the other hand it enables future additions. - return response; + return new UtcTimeResponse(requestReceptionTime, responseTransmissionTime); } } } -- cgit v1.2.3