mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-03 23:36:38 +01:00
Cleanup and fix version ordering
This commit is contained in:
@@ -730,7 +730,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public QueryResult<BaseItem> QueryRecursive(InternalItemsQuery query)
|
||||
{
|
||||
if (!query.ForceDirect && RequiresPostFiltering(query))
|
||||
if (!query.ForceDirect && CollapseBoxSetItems(query, this, query.User, ConfigurationManager))
|
||||
{
|
||||
query.CollapseBoxSetItems = true;
|
||||
SetCollapseBoxSetItemTypes(query);
|
||||
@@ -743,15 +743,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
query.Parent = this;
|
||||
}
|
||||
|
||||
if (RequiresPostFiltering2(query))
|
||||
if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes[0] == BaseItemKind.BoxSet)
|
||||
{
|
||||
return QueryWithPostFiltering2(query);
|
||||
return QueryWithPostFiltering(query);
|
||||
}
|
||||
|
||||
return LibraryManager.GetItemsResult(query);
|
||||
}
|
||||
|
||||
protected QueryResult<BaseItem> QueryWithPostFiltering2(InternalItemsQuery query)
|
||||
protected QueryResult<BaseItem> QueryWithPostFiltering(InternalItemsQuery query)
|
||||
{
|
||||
var startIndex = query.StartIndex;
|
||||
var limit = query.Limit;
|
||||
@@ -797,28 +797,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
returnItems.ToArray());
|
||||
}
|
||||
|
||||
private bool RequiresPostFiltering2(InternalItemsQuery query)
|
||||
{
|
||||
if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes[0] == BaseItemKind.BoxSet)
|
||||
{
|
||||
Logger.LogDebug("Query requires post-filtering due to BoxSet query");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool RequiresPostFiltering(InternalItemsQuery query)
|
||||
{
|
||||
if (CollapseBoxSetItems(query, this, query.User, ConfigurationManager))
|
||||
{
|
||||
Logger.LogDebug("Query requires post-filtering due to CollapseBoxSetItems");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static BaseItem[] SortItemsByRequest(InternalItemsQuery query, IReadOnlyList<BaseItem> items)
|
||||
{
|
||||
return items.OrderBy(i => Array.IndexOf(query.ItemIds, i.Id)).ToArray();
|
||||
|
||||
@@ -17,46 +17,45 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public InternalItemsQuery()
|
||||
{
|
||||
AlbumArtistIds = Array.Empty<Guid>();
|
||||
AlbumIds = Array.Empty<Guid>();
|
||||
AncestorIds = Array.Empty<Guid>();
|
||||
ArtistIds = Array.Empty<Guid>();
|
||||
BlockUnratedItems = Array.Empty<UnratedItem>();
|
||||
BoxSetLibraryFolders = Array.Empty<Guid>();
|
||||
ChannelIds = Array.Empty<Guid>();
|
||||
ContributingArtistIds = Array.Empty<Guid>();
|
||||
AlbumArtistIds = [];
|
||||
AlbumIds = [];
|
||||
AncestorIds = [];
|
||||
ArtistIds = [];
|
||||
BlockUnratedItems = [];
|
||||
BoxSetLibraryFolders = [];
|
||||
ChannelIds = [];
|
||||
ContributingArtistIds = [];
|
||||
DtoOptions = new DtoOptions();
|
||||
EnableTotalRecordCount = true;
|
||||
ExcludeArtistIds = Array.Empty<Guid>();
|
||||
ExcludeInheritedTags = Array.Empty<string>();
|
||||
IncludeInheritedTags = Array.Empty<string>();
|
||||
ExcludeItemIds = Array.Empty<Guid>();
|
||||
ExcludeItemTypes = Array.Empty<BaseItemKind>();
|
||||
ExcludeTags = Array.Empty<string>();
|
||||
ExtraTypes = Array.Empty<ExtraType>();
|
||||
GenreIds = Array.Empty<Guid>();
|
||||
Genres = Array.Empty<string>();
|
||||
ExcludeArtistIds = [];
|
||||
ExcludeInheritedTags = [];
|
||||
IncludeInheritedTags = [];
|
||||
ExcludeItemIds = [];
|
||||
ExcludeItemTypes = [];
|
||||
ExcludeTags = [];
|
||||
GenreIds = [];
|
||||
Genres = [];
|
||||
GroupByPresentationUniqueKey = true;
|
||||
ImageTypes = Array.Empty<ImageType>();
|
||||
IncludeItemTypes = Array.Empty<BaseItemKind>();
|
||||
ItemIds = Array.Empty<Guid>();
|
||||
OwnerIds = Array.Empty<Guid>();
|
||||
ExtraTypes = Array.Empty<ExtraType>();
|
||||
MediaTypes = Array.Empty<MediaType>();
|
||||
OfficialRatings = Array.Empty<string>();
|
||||
OrderBy = Array.Empty<(ItemSortBy, SortOrder)>();
|
||||
OwnerIds = Array.Empty<Guid>();
|
||||
PersonIds = Array.Empty<Guid>();
|
||||
PersonTypes = Array.Empty<string>();
|
||||
PresetViews = Array.Empty<CollectionType?>();
|
||||
SeriesStatuses = Array.Empty<SeriesStatus>();
|
||||
SourceTypes = Array.Empty<SourceType>();
|
||||
StudioIds = Array.Empty<Guid>();
|
||||
Tags = Array.Empty<string>();
|
||||
TopParentIds = Array.Empty<Guid>();
|
||||
TrailerTypes = Array.Empty<TrailerType>();
|
||||
VideoTypes = Array.Empty<VideoType>();
|
||||
Years = Array.Empty<int>();
|
||||
ImageTypes = [];
|
||||
IncludeItemTypes = [];
|
||||
ItemIds = [];
|
||||
OwnerIds = [];
|
||||
ExtraTypes = [];
|
||||
MediaTypes = [];
|
||||
OfficialRatings = [];
|
||||
OrderBy = [];
|
||||
OwnerIds = [];
|
||||
PersonIds = [];
|
||||
PersonTypes = [];
|
||||
PresetViews = [];
|
||||
SeriesStatuses = [];
|
||||
SourceTypes = [];
|
||||
StudioIds = [];
|
||||
Tags = [];
|
||||
TopParentIds = [];
|
||||
TrailerTypes = [];
|
||||
VideoTypes = [];
|
||||
Years = [];
|
||||
SkipDeserialization = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user