mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 09:59:06 -07:00
Merge pull request #5828 from jackrvan/issue-5813
Add NextUpCutoffDate to NextUpQuery
This commit is contained in:
commit
61346dd2e2
@ -154,7 +154,7 @@ namespace Emby.Server.Implementations.TV
|
||||
return i.Item1 != DateTime.MinValue;
|
||||
}
|
||||
|
||||
if (alwaysEnableFirstEpisode || i.Item1 != DateTime.MinValue)
|
||||
if (alwaysEnableFirstEpisode || (i.Item1 != DateTime.MinValue && i.Item1.Date >= request.NextUpDateCutoff))
|
||||
{
|
||||
anyFound = true;
|
||||
return true;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -13,6 +13,7 @@ namespace MediaBrowser.Model.Querying
|
||||
EnableImageTypes = Array.Empty<ImageType>();
|
||||
EnableTotalRecordCount = true;
|
||||
DisableFirstEpisode = false;
|
||||
NextUpDateCutoff = DateTime.MinValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -75,5 +76,10 @@ namespace MediaBrowser.Model.Querying
|
||||
/// Gets or sets a value indicating whether do disable sending first episode as next up.
|
||||
/// </summary>
|
||||
public bool DisableFirstEpisode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating the oldest date for a show to appear in Next Up.
|
||||
/// </summary>
|
||||
public DateTime NextUpDateCutoff { get; set; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user