diff --git a/Jellyfin.Api/Controllers/ChannelsController.cs b/Jellyfin.Api/Controllers/ChannelsController.cs index 8e0f766978..7c055874d7 100644 --- a/Jellyfin.Api/Controllers/ChannelsController.cs +++ b/Jellyfin.Api/Controllers/ChannelsController.cs @@ -42,14 +42,14 @@ namespace Jellyfin.Api.Controllers /// /// Gets available channels. /// - /// User Id. + /// User Id to filter by. Use to not filter by user. /// Optional. The record index to start at. All items with a lower index will be dropped from the results. /// Optional. The maximum number of records to return. /// Optional. Filter by channels that support getting latest items. /// Optional. Filter by channels that support media deletion. /// Optional. Filter by channels that are favorite. /// Channels returned. - /// Channels. + /// An containing the channels. [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] public ActionResult> GetChannels( @@ -75,10 +75,10 @@ namespace Jellyfin.Api.Controllers /// Get all channel features. /// /// All channel features returned. - /// Channel features. + /// An containing the channel features. [HttpGet("Features")] [ProducesResponseType(StatusCodes.Status200OK)] - public IEnumerable GetAllChannelFeatures() + public ActionResult> GetAllChannelFeatures() { return _channelManager.GetAllChannelFeatures(); } @@ -88,7 +88,7 @@ namespace Jellyfin.Api.Controllers /// /// Channel id. /// Channel features returned. - /// Channel features. + /// An containing the channel features. [HttpGet("{Id}/Features")] public ActionResult GetChannelFeatures([FromRoute] string id) { @@ -99,11 +99,11 @@ namespace Jellyfin.Api.Controllers /// Get channel items. /// /// Channel Id. - /// Folder Id. - /// User Id. + /// Optional. Folder Id. + /// Optional. User Id. /// Optional. The record index to start at. All items with a lower index will be dropped from the results. /// Optional. The maximum number of records to return. - /// Sort Order - Ascending,Descending. + /// Optional. Sort Order - Ascending,Descending. /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. @@ -175,14 +175,17 @@ namespace Jellyfin.Api.Controllers /// /// Gets latest channel items. /// - /// User Id. + /// Optional. User Id. /// Optional. The record index to start at. All items with a lower index will be dropped from the results. /// Optional. The maximum number of records to return. /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. /// Optional. Specify one or more channel id's, comma delimited. /// Latest channel items returned. - /// Latest channel items. + /// + /// A representing the request to get the latest channel items. + /// The task result contains an containing the latest channel items. + /// [HttpGet("Items/Latest")] public async Task>> GetLatestChannelItems( [FromQuery] Guid? userId, @@ -192,7 +195,7 @@ namespace Jellyfin.Api.Controllers [FromQuery] string fields, [FromQuery] string channelIds) { - var user = userId == null + var user = userId == null || userId == Guid.Empty ? null : _userManager.GetUserById(userId.Value); @@ -200,9 +203,11 @@ namespace Jellyfin.Api.Controllers { Limit = limit, StartIndex = startIndex, - ChannelIds = - (channelIds ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)) - .Select(i => new Guid(i)).ToArray(), + ChannelIds = (channelIds ?? string.Empty) + .Split(',') + .Where(i => !string.IsNullOrWhiteSpace(i)) + .Select(i => new Guid(i)) + .ToArray(), DtoOptions = new DtoOptions { Fields = RequestExtensions.GetItemFields(fields) } }; diff --git a/Jellyfin.Api/Extensions/RequestExtensions.cs b/Jellyfin.Api/Helpers/RequestHelpers.cs similarity index 100% rename from Jellyfin.Api/Extensions/RequestExtensions.cs rename to Jellyfin.Api/Helpers/RequestHelpers.cs