diff options
| author | Cody Robibero <cody@robibe.ro> | 2020-07-03 10:25:26 -0600 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2020-07-03 10:25:26 -0600 |
| commit | 0830d381c49b59d4a2ca327a79cfd4b7d8b7df0c (patch) | |
| tree | b4e78bdd67b0136658f432ffc4470ddb11485a93 | |
| parent | 13c4cb628f5f97e425bd4d392dff0d81130131db (diff) | |
Add missing endpoint
| -rw-r--r-- | Jellyfin.Api/Controllers/LiveTvController.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs index aca295419..580bf849a 100644 --- a/Jellyfin.Api/Controllers/LiveTvController.cs +++ b/Jellyfin.Api/Controllers/LiveTvController.cs @@ -725,6 +725,27 @@ namespace Jellyfin.Api.Controllers } /// <summary> + /// Gets a live tv program. + /// </summary> + /// <param name="programId">Program id.</param> + /// <param name="userId">Optional. Attach user data.</param> + /// <response code="200">Program returned.</response> + /// <returns>An <see cref="OkResult"/> containing the livetv program.</returns> + [HttpGet("Programs/{programId{")] + [Authorize(Policy = Policies.DefaultAuthorization)] + [ProducesResponseType(StatusCodes.Status200OK)] + public async Task<ActionResult<BaseItemDto>> 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); + } + + /// <summary> /// Deletes a live tv recording. /// </summary> /// <param name="recordingId">Recording id.</param> @@ -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<ActionResult> UpdateTimer([FromRoute] string timerId, [FromBody] TimerInfoDto timerInfo) { AssertUserCanManageLiveTv(); |
