mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-19 23:35:25 +03:00
Display specials within seasons
This commit is contained in:
@@ -202,6 +202,9 @@ namespace MediaBrowser.Api.UserLibrary
|
||||
|
||||
[ApiMember(Name = "MinCriticRating", Description = "Optional filter by minimum critic rating.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public double? MinCriticRating { get; set; }
|
||||
|
||||
[ApiMember(Name = "AiredDuringSeason", Description = "Gets all episodes that aired during a season, including specials.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int? AiredDuringSeason { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1000,6 +1003,25 @@ namespace MediaBrowser.Api.UserLibrary
|
||||
});
|
||||
}
|
||||
|
||||
if (request.AiredDuringSeason.HasValue)
|
||||
{
|
||||
var val = request.AiredDuringSeason.Value;
|
||||
|
||||
items = items.Where(i =>
|
||||
{
|
||||
var episode = i as Episode;
|
||||
|
||||
if (episode != null)
|
||||
{
|
||||
var seasonNumber = episode.SpecialSeasonNumber ?? episode.ParentIndexNumber;
|
||||
|
||||
return seasonNumber.HasValue && seasonNumber.Value == val;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user