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;
|
||||
|
|
|
@ -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,12 +238,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
seasons = LibraryManager.Sort(base.GetChildren(user, true), user, new[] { ItemSortBy.SortName }, SortOrder.Ascending).OfType<Season>();
|
||||
}
|
||||
|
||||
if (!includeMissingSeasons && !includeVirtualUnaired)
|
||||
{
|
||||
seasons = seasons.Where(i => !i.IsMissingOrVirtualUnaired);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!includeMissingSeasons)
|
||||
{
|
||||
seasons = seasons.Where(i => !(i.IsMissingSeason ?? false));
|
||||
|
@ -252,7 +246,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
{
|
||||
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