You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Entities/InternalItemsQuery.cs

366 lines
10 KiB

#pragma warning disable CA1044, CA1819, CA2227, CS1591
using System;
6 years ago
using System.Collections.Generic;
using System.Linq;
using Jellyfin.Data.Entities;
using Jellyfin.Data.Enums;
6 years ago
using MediaBrowser.Controller.Dto;
using MediaBrowser.Model.Entities;
6 years ago
namespace MediaBrowser.Controller.Entities
{
public class InternalItemsQuery
{
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>();
DtoOptions = new DtoOptions();
EnableTotalRecordCount = true;
ExcludeArtistIds = Array.Empty<Guid>();
ExcludeInheritedTags = Array.Empty<string>();
ExcludeItemIds = Array.Empty<Guid>();
ExcludeItemTypes = Array.Empty<string>();
ExcludeTags = Array.Empty<string>();
GenreIds = Array.Empty<Guid>();
Genres = Array.Empty<string>();
GroupByPresentationUniqueKey = true;
ImageTypes = Array.Empty<ImageType>();
IncludeItemTypes = Array.Empty<string>();
ItemIds = Array.Empty<Guid>();
MediaTypes = Array.Empty<string>();
MinSimilarityScore = 20;
OfficialRatings = Array.Empty<string>();
OrderBy = Array.Empty<ValueTuple<string, SortOrder>>();
PersonIds = Array.Empty<Guid>();
PersonTypes = Array.Empty<string>();
PresetViews = Array.Empty<string>();
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>();
}
public InternalItemsQuery(User? user)
: this()
{
if (user != null)
{
SetUser(user);
}
}
6 years ago
public bool Recursive { get; set; }
public int? StartIndex { get; set; }
public int? Limit { get; set; }
public User? User { get; set; }
6 years ago
public BaseItem? SimilarTo { get; set; }
6 years ago
public bool? IsFolder { get; set; }
6 years ago
public bool? IsFavorite { get; set; }
6 years ago
public bool? IsFavoriteOrLiked { get; set; }
6 years ago
public bool? IsLiked { get; set; }
6 years ago
public bool? IsPlayed { get; set; }
6 years ago
public bool? IsResumable { get; set; }
6 years ago
public bool? IncludeItemsByName { get; set; }
public string[] MediaTypes { get; set; }
6 years ago
public string[] IncludeItemTypes { get; set; }
6 years ago
public string[] ExcludeItemTypes { get; set; }
6 years ago
public string[] ExcludeTags { get; set; }
6 years ago
public string[] ExcludeInheritedTags { get; set; }
public IReadOnlyList<string> Genres { get; set; }
6 years ago
public bool? IsSpecialSeason { get; set; }
6 years ago
public bool? IsMissing { get; set; }
6 years ago
public bool? IsUnaired { get; set; }
6 years ago
public bool? CollapseBoxSetItems { get; set; }
public string? NameStartsWithOrGreater { get; set; }
public string? NameStartsWith { get; set; }
public string? NameLessThan { get; set; }
public string? NameContains { get; set; }
public string? MinSortName { get; set; }
6 years ago
public string? PresentationUniqueKey { get; set; }
public string? Path { get; set; }
public string? Name { get; set; }
6 years ago
public string? Person { get; set; }
6 years ago
public Guid[] PersonIds { get; set; }
6 years ago
public Guid[] ItemIds { get; set; }
6 years ago
public Guid[] ExcludeItemIds { get; set; }
public string? AdjacentTo { get; set; }
6 years ago
public string[] PersonTypes { get; set; }
public bool? Is3D { get; set; }
6 years ago
public bool? IsHD { get; set; }
6 years ago
public bool? IsLocked { get; set; }
6 years ago
public bool? IsPlaceHolder { get; set; }
public bool? HasImdbId { get; set; }
6 years ago
public bool? HasOverview { get; set; }
6 years ago
public bool? HasTmdbId { get; set; }
6 years ago
public bool? HasOfficialRating { get; set; }
6 years ago
public bool? HasTvdbId { get; set; }
6 years ago
public bool? HasThemeSong { get; set; }
6 years ago
public bool? HasThemeVideo { get; set; }
6 years ago
public bool? HasSubtitles { get; set; }
6 years ago
public bool? HasSpecialFeature { get; set; }
6 years ago
public bool? HasTrailer { get; set; }
6 years ago
public bool? HasParentalRating { get; set; }
public Guid[] StudioIds { get; set; }
public IReadOnlyList<Guid> GenreIds { get; set; }
6 years ago
public ImageType[] ImageTypes { get; set; }
6 years ago
public VideoType[] VideoTypes { get; set; }
6 years ago
public UnratedItem[] BlockUnratedItems { get; set; }
6 years ago
public int[] Years { get; set; }
6 years ago
public string[] Tags { get; set; }
6 years ago
public string[] OfficialRatings { get; set; }
public DateTime? MinPremiereDate { get; set; }
6 years ago
public DateTime? MaxPremiereDate { get; set; }
6 years ago
public DateTime? MinStartDate { get; set; }
6 years ago
public DateTime? MaxStartDate { get; set; }
6 years ago
public DateTime? MinEndDate { get; set; }
6 years ago
public DateTime? MaxEndDate { get; set; }
6 years ago
public bool? IsAiring { get; set; }
public bool? IsMovie { get; set; }
6 years ago
public bool? IsSports { get; set; }
6 years ago
public bool? IsKids { get; set; }
6 years ago
public bool? IsNews { get; set; }
6 years ago
public bool? IsSeries { get; set; }
6 years ago
public int? MinIndexNumber { get; set; }
6 years ago
public int? AiredDuringSeason { get; set; }
6 years ago
public double? MinCriticRating { get; set; }
6 years ago
public double? MinCommunityRating { get; set; }
public IReadOnlyList<Guid> ChannelIds { get; set; }
6 years ago
public int? ParentIndexNumber { get; set; }
6 years ago
public int? ParentIndexNumberNotEquals { get; set; }
6 years ago
public int? IndexNumber { get; set; }
6 years ago
public int? MinParentalRating { get; set; }
6 years ago
public int? MaxParentalRating { get; set; }
public bool? HasDeadParentId { get; set; }
6 years ago
public bool? IsVirtualItem { get; set; }
public Guid ParentId { get; set; }
public string? ParentType { get; set; }
6 years ago
public Guid[] AncestorIds { get; set; }
6 years ago
public Guid[] TopParentIds { get; set; }
public string[] PresetViews { get; set; }
6 years ago
public TrailerType[] TrailerTypes { get; set; }
6 years ago
public SourceType[] SourceTypes { get; set; }
public SeriesStatus[] SeriesStatuses { get; set; }
public string? ExternalSeriesId { get; set; }
public string? ExternalId { get; set; }
6 years ago
public Guid[] AlbumIds { get; set; }
6 years ago
public Guid[] ArtistIds { get; set; }
6 years ago
public Guid[] ExcludeArtistIds { get; set; }
public string? AncestorWithPresentationUniqueKey { get; set; }
public string? SeriesPresentationUniqueKey { get; set; }
6 years ago
public bool GroupByPresentationUniqueKey { get; set; }
6 years ago
public bool GroupBySeriesPresentationUniqueKey { get; set; }
6 years ago
public bool EnableTotalRecordCount { get; set; }
6 years ago
public bool ForceDirect { get; set; }
public Dictionary<string, string>? ExcludeProviderIds { get; set; }
6 years ago
public bool EnableGroupByMetadataKey { get; set; }
6 years ago
public bool? HasChapterImages { get; set; }
public IReadOnlyList<(string, SortOrder)> OrderBy { get; set; }
6 years ago
public DateTime? MinDateCreated { get; set; }
6 years ago
public DateTime? MinDateLastSaved { get; set; }
6 years ago
public DateTime? MinDateLastSavedForUser { get; set; }
public DtoOptions DtoOptions { get; set; }
6 years ago
public int MinSimilarityScore { get; set; }
public string? HasNoAudioTrackWithLanguage { get; set; }
public string? HasNoInternalSubtitleTrackWithLanguage { get; set; }
public string? HasNoExternalSubtitleTrackWithLanguage { get; set; }
public string? HasNoSubtitleTrackWithLanguage { get; set; }
6 years ago
public bool? IsDeadArtist { get; set; }
6 years ago
public bool? IsDeadStudio { get; set; }
6 years ago
public bool? IsDeadPerson { get; set; }
/// <summary>
/// Gets or sets a value indicating whether album sub-folders should be returned if they exist.
/// </summary>
public bool? DisplayAlbumFolders { get; set; }
public BaseItem? Parent
{
set
{
if (value == null)
{
ParentId = Guid.Empty;
ParentType = null;
}
else
{
ParentId = value.Id;
ParentType = value.GetType().Name;
}
}
}
public Dictionary<string, string>? HasAnyProviderId { get; set; }
6 years ago
public Guid[] AlbumArtistIds { get; set; }
6 years ago
public Guid[] BoxSetLibraryFolders { get; set; }
6 years ago
public Guid[] ContributingArtistIds { get; set; }
6 years ago
public bool? HasAired { get; set; }
6 years ago
public bool? HasOwnerId { get; set; }
6 years ago
public bool? Is4K { get; set; }
6 years ago
public int? MaxHeight { get; set; }
6 years ago
public int? MaxWidth { get; set; }
6 years ago
public int? MinHeight { get; set; }
6 years ago
public int? MinWidth { get; set; }
public string? SearchTerm { get; set; }
public string? SeriesTimerId { get; set; }
public void SetUser(User user)
{
MaxParentalRating = user.MaxParentalAgeRating;
if (MaxParentalRating.HasValue)
{
string other = UnratedItem.Other.ToString();
BlockUnratedItems = user.GetPreference(PreferenceKind.BlockUnratedItems)
.Where(i => i != other)
.Select(e => Enum.Parse<UnratedItem>(e, true)).ToArray();
}
ExcludeInheritedTags = user.GetPreference(PreferenceKind.BlockedTags);
User = user;
}
6 years ago
}
}