update album queries

This commit is contained in:
Luke Pulverenti 2016-03-20 20:15:56 -04:00
parent a2a0e1ae75
commit 63fe0239e3
5 changed files with 23 additions and 25 deletions

View File

@ -260,7 +260,8 @@ namespace MediaBrowser.Api.Reports
MinCommunityRating = request.MinCommunityRating, MinCommunityRating = request.MinCommunityRating,
MinCriticRating = request.MinCriticRating, MinCriticRating = request.MinCriticRating,
ParentIndexNumber = request.ParentIndexNumber, ParentIndexNumber = request.ParentIndexNumber,
AiredDuringSeason = request.AiredDuringSeason AiredDuringSeason = request.AiredDuringSeason,
AlbumArtistStartsWithOrGreater = request.AlbumArtistStartsWithOrGreater
}; };
if (!string.IsNullOrWhiteSpace(request.Ids)) if (!string.IsNullOrWhiteSpace(request.Ids))
@ -477,17 +478,6 @@ namespace MediaBrowser.Api.Reports
} }
} }
if (!string.IsNullOrEmpty(request.AlbumArtistStartsWithOrGreater))
{
var ok = new[] { i }.OfType<IHasAlbumArtist>()
.Any(p => string.Compare(request.AlbumArtistStartsWithOrGreater, p.AlbumArtists.FirstOrDefault(), StringComparison.CurrentCultureIgnoreCase) < 1);
if (!ok)
{
return false;
}
}
return true; return true;
} }

View File

@ -233,7 +233,8 @@ namespace MediaBrowser.Api.UserLibrary
MinCriticRating = request.MinCriticRating, MinCriticRating = request.MinCriticRating,
ParentId = string.IsNullOrWhiteSpace(request.ParentId) ? (Guid?)null : new Guid(request.ParentId), ParentId = string.IsNullOrWhiteSpace(request.ParentId) ? (Guid?)null : new Guid(request.ParentId),
ParentIndexNumber = request.ParentIndexNumber, ParentIndexNumber = request.ParentIndexNumber,
AiredDuringSeason = request.AiredDuringSeason AiredDuringSeason = request.AiredDuringSeason,
AlbumArtistStartsWithOrGreater = request.AlbumArtistStartsWithOrGreater
}; };
if (!string.IsNullOrWhiteSpace(request.Ids)) if (!string.IsNullOrWhiteSpace(request.Ids))
@ -435,17 +436,6 @@ namespace MediaBrowser.Api.UserLibrary
} }
} }
if (!string.IsNullOrEmpty(request.AlbumArtistStartsWithOrGreater))
{
var ok = new[] { i }.OfType<IHasAlbumArtist>()
.Any(p => string.Compare(request.AlbumArtistStartsWithOrGreater, p.AlbumArtists.FirstOrDefault(), StringComparison.CurrentCultureIgnoreCase) < 1);
if (!ok)
{
return false;
}
}
return true; return true;
} }
} }

View File

@ -1188,6 +1188,12 @@ namespace MediaBrowser.Controller.Entities
return true; return true;
} }
if (!string.IsNullOrWhiteSpace(query.AlbumArtistStartsWithOrGreater))
{
Logger.Debug("Query requires post-filtering due to AlbumArtistStartsWithOrGreater");
return true;
}
return false; return false;
} }

View File

@ -125,7 +125,8 @@ namespace MediaBrowser.Controller.Entities
public DayOfWeek[] AirDays { get; set; } public DayOfWeek[] AirDays { get; set; }
public SeriesStatus[] SeriesStatuses { get; set; } public SeriesStatus[] SeriesStatuses { get; set; }
public string AlbumArtistStartsWithOrGreater { get; set; }
public InternalItemsQuery() public InternalItemsQuery()
{ {
BlockUnratedItems = new UnratedItem[] { }; BlockUnratedItems = new UnratedItem[] { };

View File

@ -1752,6 +1752,17 @@ namespace MediaBrowser.Controller.Entities
} }
} }
if (!string.IsNullOrEmpty(query.AlbumArtistStartsWithOrGreater))
{
var ok = new[] { item }.OfType<IHasAlbumArtist>()
.Any(p => string.Compare(query.AlbumArtistStartsWithOrGreater, p.AlbumArtists.FirstOrDefault(), StringComparison.CurrentCultureIgnoreCase) < 1);
if (!ok)
{
return false;
}
}
return true; return true;
} }