From 0830d381c49b59d4a2ca327a79cfd4b7d8b7df0c Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Fri, 3 Jul 2020 10:25:26 -0600 Subject: [PATCH] Add missing endpoint --- Jellyfin.Api/Controllers/LiveTvController.cs | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs index aca295419e..580bf849a6 100644 --- a/Jellyfin.Api/Controllers/LiveTvController.cs +++ b/Jellyfin.Api/Controllers/LiveTvController.cs @@ -724,6 +724,27 @@ namespace Jellyfin.Api.Controllers return _liveTvManager.GetRecommendedPrograms(query, dtoOptions, CancellationToken.None); } + /// + /// Gets a live tv program. + /// + /// Program id. + /// Optional. Attach user data. + /// Program returned. + /// An containing the livetv program. + [HttpGet("Programs/{programId{")] + [Authorize(Policy = Policies.DefaultAuthorization)] + [ProducesResponseType(StatusCodes.Status200OK)] + public async Task> GetProgram( + [FromRoute] string programId, + [FromQuery] Guid userId) + { + var user = userId.Equals(Guid.Empty) + ? null + : _userManager.GetUserById(userId); + + return await _liveTvManager.GetProgram(programId, CancellationToken.None, user).ConfigureAwait(false); + } + /// /// Deletes a live tv recording. /// @@ -779,7 +800,7 @@ namespace Jellyfin.Api.Controllers [HttpPost("Timers/{timerId}")] [Authorize(Policy = Policies.DefaultAuthorization)] [ProducesResponseType(StatusCodes.Status204NoContent)] - [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "channelId", Justification = "Imported from ServiceStack")] + [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "timerId", Justification = "Imported from ServiceStack")] public async Task UpdateTimer([FromRoute] string timerId, [FromBody] TimerInfoDto timerInfo) { AssertUserCanManageLiveTv();