Files
pgsql-jellyfin/Jellyfin.Api/Controllers/TimeSyncController.cs
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

38 lines
1.3 KiB
C#

// <copyright file="TimeSyncController.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Api.Controllers;
using System;
using MediaBrowser.Model.SyncPlay;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
/// <summary>
/// The time sync controller.
/// </summary>
[Route("")]
public class TimeSyncController : BaseJellyfinApiController
{
/// <summary>
/// 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>
[HttpGet("GetUtcTime")]
[ProducesResponseType(statusCode: StatusCodes.Status200OK)]
public ActionResult<UtcTimeResponse> GetUtcTime()
{
// Important to keep the following line at the beginning
var requestReceptionTime = DateTime.UtcNow;
// Important to keep the following line at the end
var responseTransmissionTime = DateTime.UtcNow;
// Implementing NTP on such a high level results in this useless
// information being sent. On the other hand it enables future additions.
return new UtcTimeResponse(requestReceptionTime, responseTransmissionTime);
}
}