aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/TvShowsController.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2021-09-05 10:11:17 +0200
committercvium <clausvium@gmail.com>2021-09-05 10:11:17 +0200
commitffe5ae8056d2f145bacae120b56fde39d132dc6f (patch)
tree174625f71dae8abd79fb87ca606b514c407b770c /Jellyfin.Api/Controllers/TvShowsController.cs
parent417a7011c7b5fe4a5ca5ce7c0b61c14f15bc748b (diff)
parentff83fabac35a7bf8756a8d822b8f031d700dbb64 (diff)
Merge branch 'master' into TVFix
Diffstat (limited to 'Jellyfin.Api/Controllers/TvShowsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/TvShowsController.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/Jellyfin.Api/Controllers/TvShowsController.cs b/Jellyfin.Api/Controllers/TvShowsController.cs
index 59400db2a..7c5b8a43b 100644
--- a/Jellyfin.Api/Controllers/TvShowsController.cs
+++ b/Jellyfin.Api/Controllers/TvShowsController.cs
@@ -6,7 +6,7 @@ using Jellyfin.Api.Constants;
using Jellyfin.Api.Extensions;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Data.Enums;
-using MediaBrowser.Common.Extensions;
+using Jellyfin.Extensions;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
@@ -65,6 +65,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="imageTypeLimit">Optional. The max number of images to return, per image type.</param>
/// <param name="enableImageTypes">Optional. The image types to include in the output.</param>
/// <param name="enableUserData">Optional. Include user data.</param>
+ /// <param name="nextUpDateCutoff">Optional. Starting date of shows to show in Next Up section.</param>
/// <param name="enableTotalRecordCount">Whether to enable the total records count. Defaults to true.</param>
/// <param name="disableFirstEpisode">Whether to disable sending the first episode in a series as next up.</param>
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the next up episodes.</returns>
@@ -81,6 +82,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageTypeLimit,
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes,
[FromQuery] bool? enableUserData,
+ [FromQuery] DateTime? nextUpDateCutoff,
[FromQuery] bool enableTotalRecordCount = true,
[FromQuery] bool disableFirstEpisode = false)
{
@@ -97,7 +99,8 @@ namespace Jellyfin.Api.Controllers
StartIndex = startIndex,
UserId = userId ?? Guid.Empty,
EnableTotalRecordCount = enableTotalRecordCount,
- DisableFirstEpisode = disableFirstEpisode
+ DisableFirstEpisode = disableFirstEpisode,
+ NextUpDateCutoff = nextUpDateCutoff ?? DateTime.MinValue
},
options);
@@ -225,7 +228,7 @@ namespace Jellyfin.Api.Controllers
if (seasonId.HasValue) // Season id was supplied. Get episodes by season id.
{
var item = _libraryManager.GetItemById(seasonId.Value);
- if (!(item is Season seasonItem))
+ if (item is not Season seasonItem)
{
return NotFound("No season exists with Id " + seasonId);
}
@@ -234,7 +237,7 @@ namespace Jellyfin.Api.Controllers
}
else if (season.HasValue) // Season number was supplied. Get episodes by season number
{
- if (!(_libraryManager.GetItemById(seriesId) is Series series))
+ if (_libraryManager.GetItemById(seriesId) is not Series series)
{
return NotFound("Series not found");
}
@@ -249,7 +252,7 @@ namespace Jellyfin.Api.Controllers
}
else // No season number or season id was supplied. Returning all episodes.
{
- if (!(_libraryManager.GetItemById(seriesId) is Series series))
+ if (_libraryManager.GetItemById(seriesId) is not Series series)
{
return NotFound("Series not found");
}
@@ -333,7 +336,7 @@ namespace Jellyfin.Api.Controllers
? _userManager.GetUserById(userId.Value)
: null;
- if (!(_libraryManager.GetItemById(seriesId) is Series series))
+ if (_libraryManager.GetItemById(seriesId) is not Series series)
{
return NotFound("Series not found");
}