mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-06 06:07:05 +02:00
Merge 46003b66b1
into db7465e83d
This commit is contained in:
commit
e738569612
@ -144,7 +144,6 @@ public class LiveTvController : BaseJellyfinApiController
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
[HttpGet("Channels")]
|
[HttpGet("Channels")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[Authorize(Policy = Policies.LiveTvAccess)]
|
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetLiveTvChannels(
|
public ActionResult<QueryResult<BaseItemDto>> GetLiveTvChannels(
|
||||||
[FromQuery] ChannelType? type,
|
[FromQuery] ChannelType? type,
|
||||||
[FromQuery] Guid? userId,
|
[FromQuery] Guid? userId,
|
||||||
@ -168,6 +167,15 @@ public class LiveTvController : BaseJellyfinApiController
|
|||||||
[FromQuery] bool enableFavoriteSorting = false,
|
[FromQuery] bool enableFavoriteSorting = false,
|
||||||
[FromQuery] bool addCurrentProgram = true)
|
[FromQuery] bool addCurrentProgram = true)
|
||||||
{
|
{
|
||||||
|
// Check if authenticated user has Live TV access
|
||||||
|
var authenticatedUserId = User.GetUserId();
|
||||||
|
var authenticatedUser = _userManager.GetUserById(authenticatedUserId);
|
||||||
|
if (authenticatedUser == null || !authenticatedUser.HasPermission(PermissionKind.EnableLiveTvAccess))
|
||||||
|
{
|
||||||
|
// Return empty result instead of 403 to prevent metadata manager failures
|
||||||
|
return new QueryResult<BaseItemDto>();
|
||||||
|
}
|
||||||
|
|
||||||
userId = RequestHelpers.GetUserId(User, userId);
|
userId = RequestHelpers.GetUserId(User, userId);
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(User)
|
.AddClientFields(User)
|
||||||
@ -273,7 +281,6 @@ public class LiveTvController : BaseJellyfinApiController
|
|||||||
/// <returns>An <see cref="OkResult"/> containing the live tv recordings.</returns>
|
/// <returns>An <see cref="OkResult"/> containing the live tv recordings.</returns>
|
||||||
[HttpGet("Recordings")]
|
[HttpGet("Recordings")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[Authorize(Policy = Policies.LiveTvAccess)]
|
|
||||||
public async Task<ActionResult<QueryResult<BaseItemDto>>> GetRecordings(
|
public async Task<ActionResult<QueryResult<BaseItemDto>>> GetRecordings(
|
||||||
[FromQuery] string? channelId,
|
[FromQuery] string? channelId,
|
||||||
[FromQuery] Guid? userId,
|
[FromQuery] Guid? userId,
|
||||||
@ -295,6 +302,15 @@ public class LiveTvController : BaseJellyfinApiController
|
|||||||
[FromQuery] bool? isLibraryItem,
|
[FromQuery] bool? isLibraryItem,
|
||||||
[FromQuery] bool enableTotalRecordCount = true)
|
[FromQuery] bool enableTotalRecordCount = true)
|
||||||
{
|
{
|
||||||
|
// Check if authenticated user has Live TV access
|
||||||
|
var authenticatedUserId = User.GetUserId();
|
||||||
|
var authenticatedUser = _userManager.GetUserById(authenticatedUserId);
|
||||||
|
if (authenticatedUser == null || !authenticatedUser.HasPermission(PermissionKind.EnableLiveTvAccess))
|
||||||
|
{
|
||||||
|
// Return empty result instead of 403 to prevent metadata manager failures
|
||||||
|
return new QueryResult<BaseItemDto>();
|
||||||
|
}
|
||||||
|
|
||||||
userId = RequestHelpers.GetUserId(User, userId);
|
userId = RequestHelpers.GetUserId(User, userId);
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
.AddClientFields(User)
|
.AddClientFields(User)
|
||||||
|
Loading…
Reference in New Issue
Block a user