update season filters
This commit is contained in:
parent
06a25a2557
commit
432c52f934
|
@ -415,17 +415,6 @@ namespace MediaBrowser.Api
|
|||
|
||||
private IEnumerable<Season> FilterVirtualSeasons(GetSeasons request, IEnumerable<Season> items)
|
||||
{
|
||||
if (request.IsMissing.HasValue && request.IsVirtualUnaired.HasValue)
|
||||
{
|
||||
var isMissing = request.IsMissing.Value;
|
||||
var isVirtualUnaired = request.IsVirtualUnaired.Value;
|
||||
|
||||
if (!isMissing && !isVirtualUnaired)
|
||||
{
|
||||
return items.Where(i => !i.IsMissingOrVirtualUnaired);
|
||||
}
|
||||
}
|
||||
|
||||
if (request.IsMissing.HasValue)
|
||||
{
|
||||
var val = request.IsMissing.Value;
|
||||
|
|
|
@ -772,7 +772,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var supportsUserDataQueries = ConfigurationManager.Configuration.SchemaVersion >= 76;
|
||||
|
||||
if (query.SortBy != null && query.SortBy.Length > 0)
|
||||
|
@ -1294,7 +1294,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <summary>
|
||||
/// Adds the children to list.
|
||||
/// </summary>
|
||||
private void AddChildrenToList(Dictionary<Guid,BaseItem> result, bool includeLinkedChildren, bool recursive, Func<BaseItem, bool> filter)
|
||||
private void AddChildrenToList(Dictionary<Guid, BaseItem> result, bool includeLinkedChildren, bool recursive, Func<BaseItem, bool> filter)
|
||||
{
|
||||
foreach (var child in Children)
|
||||
{
|
||||
|
@ -1525,14 +1525,12 @@ namespace MediaBrowser.Controller.Entities
|
|||
User = user,
|
||||
Recursive = true,
|
||||
IsFolder = false,
|
||||
IsUnaired = false,
|
||||
EnableTotalRecordCount = false
|
||||
|
||||
};
|
||||
|
||||
if (!user.Configuration.DisplayMissingEpisodes)
|
||||
if (!user.Configuration.DisplayMissingEpisodes || !user.Configuration.DisplayUnairedEpisodes)
|
||||
{
|
||||
query.IsMissing = false;
|
||||
query.ExcludeLocationTypes = new[] { LocationType.Virtual };
|
||||
}
|
||||
|
||||
var itemsResult = await GetItems(query).ConfigureAwait(false);
|
||||
|
|
|
@ -152,12 +152,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
get { return LocationType == LocationType.Virtual && IsUnaired; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsMissingOrVirtualUnaired
|
||||
{
|
||||
get { return (IsMissingSeason ?? false) || (LocationType == LocationType.Virtual && IsUnaired); }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsSpecialSeason
|
||||
{
|
||||
|
|
|
@ -238,20 +238,13 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
seasons = LibraryManager.Sort(base.GetChildren(user, true), user, new[] { ItemSortBy.SortName }, SortOrder.Ascending).OfType<Season>();
|
||||
}
|
||||
|
||||
if (!includeMissingSeasons && !includeVirtualUnaired)
|
||||
if (!includeMissingSeasons)
|
||||
{
|
||||
seasons = seasons.Where(i => !i.IsMissingOrVirtualUnaired);
|
||||
seasons = seasons.Where(i => !(i.IsMissingSeason ?? false));
|
||||
}
|
||||
else
|
||||
if (!includeVirtualUnaired)
|
||||
{
|
||||
if (!includeMissingSeasons)
|
||||
{
|
||||
seasons = seasons.Where(i => !(i.IsMissingSeason ?? false));
|
||||
}
|
||||
if (!includeVirtualUnaired)
|
||||
{
|
||||
seasons = seasons.Where(i => !i.IsVirtualUnaired);
|
||||
}
|
||||
seasons = seasons.Where(i => !i.IsVirtualUnaired);
|
||||
}
|
||||
|
||||
return seasons;
|
||||
|
|
|
@ -1134,22 +1134,6 @@ namespace MediaBrowser.Controller.Entities
|
|||
bool? isVirtualUnaired,
|
||||
bool? isUnaired)
|
||||
{
|
||||
if (isMissing.HasValue && isVirtualUnaired.HasValue)
|
||||
{
|
||||
if (!isMissing.Value && !isVirtualUnaired.Value)
|
||||
{
|
||||
return items.Where(i =>
|
||||
{
|
||||
var e = i as Season;
|
||||
if (e != null)
|
||||
{
|
||||
return !e.IsMissingOrVirtualUnaired;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (isMissing.HasValue)
|
||||
{
|
||||
var val = isMissing.Value;
|
||||
|
|
Loading…
Reference in New Issue
Block a user