aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/TimeSyncController.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-12-04 20:22:30 -0500
committerGitHub <noreply@github.com>2020-12-04 20:22:30 -0500
commitbba01bf7b9f63e0e19c133bed201db29fa60a833 (patch)
treef5cad92410ed1809dff3feeb82be5df08f2a4705 /Jellyfin.Api/Controllers/TimeSyncController.cs
parentb96d4ef0e8ffa8429c25c83739a9c392a12e9d82 (diff)
parentcc64ee483d6620319d148ad27dbd1e26d8195ea6 (diff)
Merge pull request #3194 from OancaAndrei/syncplay-enhanced
SyncPlay for TV series (and Music)
Diffstat (limited to 'Jellyfin.Api/Controllers/TimeSyncController.cs')
-rw-r--r--Jellyfin.Api/Controllers/TimeSyncController.cs14
1 files changed, 5 insertions, 9 deletions
diff --git a/Jellyfin.Api/Controllers/TimeSyncController.cs b/Jellyfin.Api/Controllers/TimeSyncController.cs
index 27c7186fc..c730ac12b 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
{
/// <summary>
- /// Gets the current utc time.
+ /// Gets the current UTC time.
/// </summary>
/// <response code="200">Time returned.</response>
/// <returns>An <see cref="UtcTimeResponse"/> to sync the client and server time.</returns>
@@ -22,18 +22,14 @@ namespace Jellyfin.Api.Controllers
public ActionResult<UtcTimeResponse> 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);
}
}
}