fix include/exclude item type queries

pull/702/head
Luke Pulverenti 12 years ago
parent 3f9a412b02
commit 44ff7167f0

@ -357,6 +357,20 @@ namespace MediaBrowser.Api.UserLibrary
/// <returns>IEnumerable{BaseItem}.</returns>
internal static IEnumerable<BaseItem> ApplyAdditionalFilters(GetItems request, IEnumerable<BaseItem> items)
{
// Exclude item types
if (!string.IsNullOrEmpty(request.ExcludeItemTypes))
{
var vals = request.ExcludeItemTypes.Split(',');
items = items.Where(f => !vals.Contains(f.GetType().Name, StringComparer.OrdinalIgnoreCase));
}
// Include item types
if (!string.IsNullOrEmpty(request.IncludeItemTypes))
{
var vals = request.IncludeItemTypes.Split(',');
items = items.Where(f => vals.Contains(f.GetType().Name, StringComparer.OrdinalIgnoreCase));
}
// Filter by Series Status
if (!string.IsNullOrEmpty(request.SeriesStatus))
{

Loading…
Cancel
Save