Merge pull request #6979 from crobibero/baseitemkind
Use BaseItemKind where possible
This commit is contained in:
commit
4c9bd905c6
|
@ -539,7 +539,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
User = user,
|
User = user,
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
IsMissing = false,
|
IsMissing = false,
|
||||||
ExcludeItemTypes = new[] { nameof(Book) },
|
ExcludeItemTypes = new[] { BaseItemKind.Book },
|
||||||
IsFolder = isFolder,
|
IsFolder = isFolder,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
DtoOptions = GetDtoOptions()
|
DtoOptions = GetDtoOptions()
|
||||||
|
@ -619,7 +619,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
ExcludeItemTypes = new[] { nameof(Book) },
|
ExcludeItemTypes = new[] { BaseItemKind.Book },
|
||||||
IsPlaceHolder = false,
|
IsPlaceHolder = false,
|
||||||
DtoOptions = GetDtoOptions(),
|
DtoOptions = GetDtoOptions(),
|
||||||
OrderBy = GetOrderBy(sort, folder.IsPreSorted)
|
OrderBy = GetOrderBy(sort, folder.IsPreSorted)
|
||||||
|
@ -644,7 +644,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
{
|
{
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
IncludeItemTypes = new[] { nameof(LiveTvChannel) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvChannel },
|
||||||
OrderBy = GetOrderBy(sort, false)
|
OrderBy = GetOrderBy(sort, false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -675,23 +675,23 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
switch (stubType)
|
switch (stubType)
|
||||||
{
|
{
|
||||||
case StubType.Latest:
|
case StubType.Latest:
|
||||||
return GetLatest(item, query, nameof(Audio));
|
return GetLatest(item, query, BaseItemKind.Audio);
|
||||||
case StubType.Playlists:
|
case StubType.Playlists:
|
||||||
return GetMusicPlaylists(query);
|
return GetMusicPlaylists(query);
|
||||||
case StubType.Albums:
|
case StubType.Albums:
|
||||||
return GetChildrenOfItem(item, query, nameof(MusicAlbum));
|
return GetChildrenOfItem(item, query, BaseItemKind.MusicAlbum);
|
||||||
case StubType.Artists:
|
case StubType.Artists:
|
||||||
return GetMusicArtists(item, query);
|
return GetMusicArtists(item, query);
|
||||||
case StubType.AlbumArtists:
|
case StubType.AlbumArtists:
|
||||||
return GetMusicAlbumArtists(item, query);
|
return GetMusicAlbumArtists(item, query);
|
||||||
case StubType.FavoriteAlbums:
|
case StubType.FavoriteAlbums:
|
||||||
return GetChildrenOfItem(item, query, nameof(MusicAlbum), true);
|
return GetChildrenOfItem(item, query, BaseItemKind.MusicAlbum, true);
|
||||||
case StubType.FavoriteArtists:
|
case StubType.FavoriteArtists:
|
||||||
return GetFavoriteArtists(item, query);
|
return GetFavoriteArtists(item, query);
|
||||||
case StubType.FavoriteSongs:
|
case StubType.FavoriteSongs:
|
||||||
return GetChildrenOfItem(item, query, nameof(Audio), true);
|
return GetChildrenOfItem(item, query, BaseItemKind.Audio, true);
|
||||||
case StubType.Songs:
|
case StubType.Songs:
|
||||||
return GetChildrenOfItem(item, query, nameof(Audio));
|
return GetChildrenOfItem(item, query, BaseItemKind.Audio);
|
||||||
case StubType.Genres:
|
case StubType.Genres:
|
||||||
return GetMusicGenres(item, query);
|
return GetMusicGenres(item, query);
|
||||||
}
|
}
|
||||||
|
@ -746,13 +746,13 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
case StubType.ContinueWatching:
|
case StubType.ContinueWatching:
|
||||||
return GetMovieContinueWatching(item, query);
|
return GetMovieContinueWatching(item, query);
|
||||||
case StubType.Latest:
|
case StubType.Latest:
|
||||||
return GetLatest(item, query, nameof(Movie));
|
return GetLatest(item, query, BaseItemKind.Movie);
|
||||||
case StubType.Movies:
|
case StubType.Movies:
|
||||||
return GetChildrenOfItem(item, query, nameof(Movie));
|
return GetChildrenOfItem(item, query, BaseItemKind.Movie);
|
||||||
case StubType.Collections:
|
case StubType.Collections:
|
||||||
return GetMovieCollections(query);
|
return GetMovieCollections(query);
|
||||||
case StubType.Favorites:
|
case StubType.Favorites:
|
||||||
return GetChildrenOfItem(item, query, nameof(Movie), true);
|
return GetChildrenOfItem(item, query, BaseItemKind.Movie, true);
|
||||||
case StubType.Genres:
|
case StubType.Genres:
|
||||||
return GetGenres(item, query);
|
return GetGenres(item, query);
|
||||||
}
|
}
|
||||||
|
@ -831,13 +831,13 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
case StubType.NextUp:
|
case StubType.NextUp:
|
||||||
return GetNextUp(item, query);
|
return GetNextUp(item, query);
|
||||||
case StubType.Latest:
|
case StubType.Latest:
|
||||||
return GetLatest(item, query, nameof(Episode));
|
return GetLatest(item, query, BaseItemKind.Episode);
|
||||||
case StubType.Series:
|
case StubType.Series:
|
||||||
return GetChildrenOfItem(item, query, nameof(Series));
|
return GetChildrenOfItem(item, query, BaseItemKind.Series);
|
||||||
case StubType.FavoriteSeries:
|
case StubType.FavoriteSeries:
|
||||||
return GetChildrenOfItem(item, query, nameof(Series), true);
|
return GetChildrenOfItem(item, query, BaseItemKind.Series, true);
|
||||||
case StubType.FavoriteEpisodes:
|
case StubType.FavoriteEpisodes:
|
||||||
return GetChildrenOfItem(item, query, nameof(Episode), true);
|
return GetChildrenOfItem(item, query, BaseItemKind.Episode, true);
|
||||||
case StubType.Genres:
|
case StubType.Genres:
|
||||||
return GetGenres(item, query);
|
return GetGenres(item, query);
|
||||||
}
|
}
|
||||||
|
@ -898,7 +898,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
private QueryResult<ServerItem> GetMovieCollections(InternalItemsQuery query)
|
private QueryResult<ServerItem> GetMovieCollections(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
query.Recursive = true;
|
query.Recursive = true;
|
||||||
query.IncludeItemTypes = new[] { nameof(BoxSet) };
|
query.IncludeItemTypes = new[] { BaseItemKind.BoxSet };
|
||||||
|
|
||||||
var result = _libraryManager.GetItemsResult(query);
|
var result = _libraryManager.GetItemsResult(query);
|
||||||
|
|
||||||
|
@ -913,7 +913,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
/// <param name="itemType">The item type.</param>
|
/// <param name="itemType">The item type.</param>
|
||||||
/// <param name="isFavorite">A value indicating whether to only fetch favorite items.</param>
|
/// <param name="isFavorite">A value indicating whether to only fetch favorite items.</param>
|
||||||
/// <returns>The <see cref="QueryResult{ServerItem}"/>.</returns>
|
/// <returns>The <see cref="QueryResult{ServerItem}"/>.</returns>
|
||||||
private QueryResult<ServerItem> GetChildrenOfItem(BaseItem parent, InternalItemsQuery query, string itemType, bool isFavorite = false)
|
private QueryResult<ServerItem> GetChildrenOfItem(BaseItem parent, InternalItemsQuery query, BaseItemKind itemType, bool isFavorite = false)
|
||||||
{
|
{
|
||||||
query.Recursive = true;
|
query.Recursive = true;
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
|
@ -1013,7 +1013,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
private QueryResult<ServerItem> GetMusicPlaylists(InternalItemsQuery query)
|
private QueryResult<ServerItem> GetMusicPlaylists(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
query.Parent = null;
|
query.Parent = null;
|
||||||
query.IncludeItemTypes = new[] { nameof(Playlist) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Playlist };
|
||||||
query.Recursive = true;
|
query.Recursive = true;
|
||||||
|
|
||||||
var result = _libraryManager.GetItemsResult(query);
|
var result = _libraryManager.GetItemsResult(query);
|
||||||
|
@ -1052,7 +1052,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
/// <param name="query">The <see cref="InternalItemsQuery"/>.</param>
|
/// <param name="query">The <see cref="InternalItemsQuery"/>.</param>
|
||||||
/// <param name="itemType">The item type.</param>
|
/// <param name="itemType">The item type.</param>
|
||||||
/// <returns>The <see cref="QueryResult{ServerItem}"/>.</returns>
|
/// <returns>The <see cref="QueryResult{ServerItem}"/>.</returns>
|
||||||
private QueryResult<ServerItem> GetLatest(BaseItem parent, InternalItemsQuery query, string itemType)
|
private QueryResult<ServerItem> GetLatest(BaseItem parent, InternalItemsQuery query, BaseItemKind itemType)
|
||||||
{
|
{
|
||||||
query.OrderBy = Array.Empty<(string, SortOrder)>();
|
query.OrderBy = Array.Empty<(string, SortOrder)>();
|
||||||
|
|
||||||
|
@ -1086,7 +1086,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
{
|
{
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
ArtistIds = new[] { item.Id },
|
ArtistIds = new[] { item.Id },
|
||||||
IncludeItemTypes = new[] { nameof(MusicAlbum) },
|
IncludeItemTypes = new[] { BaseItemKind.MusicAlbum },
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
DtoOptions = GetDtoOptions(),
|
DtoOptions = GetDtoOptions(),
|
||||||
|
@ -1115,8 +1115,8 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
GenreIds = new[] { item.Id },
|
GenreIds = new[] { item.Id },
|
||||||
IncludeItemTypes = new[]
|
IncludeItemTypes = new[]
|
||||||
{
|
{
|
||||||
nameof(Movie),
|
BaseItemKind.Movie,
|
||||||
nameof(Series)
|
BaseItemKind.Series
|
||||||
},
|
},
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
|
@ -1144,7 +1144,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||||
{
|
{
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
GenreIds = new[] { item.Id },
|
GenreIds = new[] { item.Id },
|
||||||
IncludeItemTypes = new[] { nameof(MusicAlbum) },
|
IncludeItemTypes = new[] { BaseItemKind.MusicAlbum },
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
DtoOptions = GetDtoOptions(),
|
DtoOptions = GetDtoOptions(),
|
||||||
|
|
|
@ -541,7 +541,7 @@ namespace Emby.Server.Implementations.Channels
|
||||||
return _libraryManager.GetItemIds(
|
return _libraryManager.GetItemIds(
|
||||||
new InternalItemsQuery
|
new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Channel) },
|
IncludeItemTypes = new[] { BaseItemKind.Channel },
|
||||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) }
|
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) }
|
||||||
}).Select(i => GetChannelFeatures(i)).ToArray();
|
}).Select(i => GetChannelFeatures(i)).ToArray();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Channels;
|
using MediaBrowser.Controller.Channels;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
|
@ -51,7 +52,7 @@ namespace Emby.Server.Implementations.Channels
|
||||||
|
|
||||||
var uninstalledChannels = _libraryManager.GetItemList(new InternalItemsQuery
|
var uninstalledChannels = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Channel) },
|
IncludeItemTypes = new[] { BaseItemKind.Channel },
|
||||||
ExcludeItemIds = installedChannelIds.ToArray()
|
ExcludeItemIds = installedChannelIds.ToArray()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -196,57 +196,56 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
private static readonly string _mediaAttachmentInsertPrefix;
|
private static readonly string _mediaAttachmentInsertPrefix;
|
||||||
|
|
||||||
private static readonly HashSet<string> _programTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly BaseItemKind[] _programTypes = new[]
|
||||||
{
|
{
|
||||||
"Program",
|
BaseItemKind.Program,
|
||||||
"TvChannel",
|
BaseItemKind.TvChannel,
|
||||||
"LiveTvProgram",
|
BaseItemKind.LiveTvProgram,
|
||||||
"LiveTvTvChannel"
|
BaseItemKind.LiveTvChannel
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly HashSet<string> _programExcludeParentTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly BaseItemKind[] _programExcludeParentTypes = new[]
|
||||||
{
|
{
|
||||||
"Series",
|
BaseItemKind.Series,
|
||||||
"Season",
|
BaseItemKind.Season,
|
||||||
"MusicAlbum",
|
BaseItemKind.MusicAlbum,
|
||||||
"MusicArtist",
|
BaseItemKind.MusicArtist,
|
||||||
"PhotoAlbum"
|
BaseItemKind.PhotoAlbum
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly HashSet<string> _serviceTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly BaseItemKind[] _serviceTypes = new[]
|
||||||
{
|
{
|
||||||
"TvChannel",
|
BaseItemKind.TvChannel,
|
||||||
"LiveTvTvChannel"
|
BaseItemKind.LiveTvChannel
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly HashSet<string> _startDateTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly BaseItemKind[] _startDateTypes = new[]
|
||||||
{
|
{
|
||||||
"Program",
|
BaseItemKind.Program,
|
||||||
"LiveTvProgram"
|
BaseItemKind.LiveTvProgram
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly HashSet<string> _seriesTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly BaseItemKind[] _seriesTypes = new[]
|
||||||
{
|
{
|
||||||
"Book",
|
BaseItemKind.Book,
|
||||||
"AudioBook",
|
BaseItemKind.AudioBook,
|
||||||
"Episode",
|
BaseItemKind.Episode,
|
||||||
"Season"
|
BaseItemKind.Season
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly HashSet<string> _artistExcludeParentTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly BaseItemKind[] _artistExcludeParentTypes = new[]
|
||||||
{
|
{
|
||||||
"Series",
|
BaseItemKind.Series,
|
||||||
"Season",
|
BaseItemKind.Season,
|
||||||
"PhotoAlbum"
|
BaseItemKind.PhotoAlbum
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly HashSet<string> _artistsTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private static readonly BaseItemKind[] _artistsTypes = new[]
|
||||||
{
|
{
|
||||||
"Audio",
|
BaseItemKind.Audio,
|
||||||
"MusicAlbum",
|
BaseItemKind.MusicAlbum,
|
||||||
"MusicVideo",
|
BaseItemKind.MusicVideo,
|
||||||
"AudioBook",
|
BaseItemKind.AudioBook
|
||||||
"AudioPodcast"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly Type[] _knownTypes =
|
private static readonly Type[] _knownTypes =
|
||||||
|
@ -2212,7 +2211,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
private bool HasProgramAttributes(InternalItemsQuery query)
|
private bool HasProgramAttributes(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (_programExcludeParentTypes.Contains(query.ParentType))
|
if (query.ParentType != null && _programExcludeParentTypes.Contains(query.ParentType.Value))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2227,7 +2226,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
private bool HasServiceName(InternalItemsQuery query)
|
private bool HasServiceName(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (_programExcludeParentTypes.Contains(query.ParentType))
|
if (query.ParentType != null && _programExcludeParentTypes.Contains(query.ParentType.Value))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2242,7 +2241,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
private bool HasStartDate(InternalItemsQuery query)
|
private bool HasStartDate(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (_programExcludeParentTypes.Contains(query.ParentType))
|
if (query.ParentType != null && _programExcludeParentTypes.Contains(query.ParentType.Value))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2262,7 +2261,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return query.IncludeItemTypes.Contains("Episode", StringComparer.OrdinalIgnoreCase);
|
return query.IncludeItemTypes.Contains(BaseItemKind.Episode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HasTrailerTypes(InternalItemsQuery query)
|
private bool HasTrailerTypes(InternalItemsQuery query)
|
||||||
|
@ -2272,12 +2271,12 @@ namespace Emby.Server.Implementations.Data
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return query.IncludeItemTypes.Contains("Trailer", StringComparer.OrdinalIgnoreCase);
|
return query.IncludeItemTypes.Contains(BaseItemKind.Trailer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HasArtistFields(InternalItemsQuery query)
|
private bool HasArtistFields(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (_artistExcludeParentTypes.Contains(query.ParentType))
|
if (query.ParentType != null && _artistExcludeParentTypes.Contains(query.ParentType.Value))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2292,7 +2291,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
private bool HasSeriesFields(InternalItemsQuery query)
|
private bool HasSeriesFields(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (string.Equals(query.ParentType, "PhotoAlbum", StringComparison.OrdinalIgnoreCase))
|
if (query.ParentType == BaseItemKind.PhotoAlbum)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -3487,8 +3486,8 @@ namespace Emby.Server.Implementations.Data
|
||||||
if (query.IsMovie == true)
|
if (query.IsMovie == true)
|
||||||
{
|
{
|
||||||
if (query.IncludeItemTypes.Length == 0
|
if (query.IncludeItemTypes.Length == 0
|
||||||
|| query.IncludeItemTypes.Contains(nameof(Movie))
|
|| query.IncludeItemTypes.Contains(BaseItemKind.Movie)
|
||||||
|| query.IncludeItemTypes.Contains(nameof(Trailer)))
|
|| query.IncludeItemTypes.Contains(BaseItemKind.Trailer))
|
||||||
{
|
{
|
||||||
whereClauses.Add("(IsMovie is null OR IsMovie=@IsMovie)");
|
whereClauses.Add("(IsMovie is null OR IsMovie=@IsMovie)");
|
||||||
}
|
}
|
||||||
|
@ -3563,15 +3562,15 @@ namespace Emby.Server.Implementations.Data
|
||||||
statement?.TryBind("@IsFolder", query.IsFolder);
|
statement?.TryBind("@IsFolder", query.IsFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
var includeTypes = query.IncludeItemTypes.Select(MapIncludeItemTypes).Where(x => x != null).ToArray();
|
var includeTypes = query.IncludeItemTypes;
|
||||||
// Only specify excluded types if no included types are specified
|
// Only specify excluded types if no included types are specified
|
||||||
if (includeTypes.Length == 0)
|
if (query.IncludeItemTypes.Length == 0)
|
||||||
{
|
{
|
||||||
var excludeTypes = query.ExcludeItemTypes.Select(MapIncludeItemTypes).Where(x => x != null).ToArray();
|
var excludeTypes = query.ExcludeItemTypes;
|
||||||
if (excludeTypes.Length == 1)
|
if (excludeTypes.Length == 1)
|
||||||
{
|
{
|
||||||
whereClauses.Add("type<>@type");
|
whereClauses.Add("type<>@type");
|
||||||
statement?.TryBind("@type", excludeTypes[0]);
|
statement?.TryBind("@type", excludeTypes[0].ToString());
|
||||||
}
|
}
|
||||||
else if (excludeTypes.Length > 1)
|
else if (excludeTypes.Length > 1)
|
||||||
{
|
{
|
||||||
|
@ -3582,7 +3581,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
else if (includeTypes.Length == 1)
|
else if (includeTypes.Length == 1)
|
||||||
{
|
{
|
||||||
whereClauses.Add("type=@type");
|
whereClauses.Add("type=@type");
|
||||||
statement?.TryBind("@type", includeTypes[0]);
|
statement?.TryBind("@type", includeTypes[0].ToString());
|
||||||
}
|
}
|
||||||
else if (includeTypes.Length > 1)
|
else if (includeTypes.Length > 1)
|
||||||
{
|
{
|
||||||
|
@ -3911,7 +3910,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
if (query.IsPlayed.HasValue)
|
if (query.IsPlayed.HasValue)
|
||||||
{
|
{
|
||||||
// We should probably figure this out for all folders, but for right now, this is the only place where we need it
|
// We should probably figure this out for all folders, but for right now, this is the only place where we need it
|
||||||
if (query.IncludeItemTypes.Length == 1 && string.Equals(query.IncludeItemTypes[0], nameof(Series), StringComparison.OrdinalIgnoreCase))
|
if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes[0] == BaseItemKind.Series)
|
||||||
{
|
{
|
||||||
if (query.IsPlayed.Value)
|
if (query.IsPlayed.Value)
|
||||||
{
|
{
|
||||||
|
@ -4761,27 +4760,27 @@ namespace Emby.Server.Implementations.Data
|
||||||
{
|
{
|
||||||
var list = new List<string>();
|
var list = new List<string>();
|
||||||
|
|
||||||
if (IsTypeInQuery(nameof(Person), query))
|
if (IsTypeInQuery(BaseItemKind.Person, query))
|
||||||
{
|
{
|
||||||
list.Add(typeof(Person).FullName);
|
list.Add(typeof(Person).FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsTypeInQuery(nameof(Genre), query))
|
if (IsTypeInQuery(BaseItemKind.Genre, query))
|
||||||
{
|
{
|
||||||
list.Add(typeof(Genre).FullName);
|
list.Add(typeof(Genre).FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsTypeInQuery(nameof(MusicGenre), query))
|
if (IsTypeInQuery(BaseItemKind.MusicGenre, query))
|
||||||
{
|
{
|
||||||
list.Add(typeof(MusicGenre).FullName);
|
list.Add(typeof(MusicGenre).FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsTypeInQuery(nameof(MusicArtist), query))
|
if (IsTypeInQuery(BaseItemKind.MusicArtist, query))
|
||||||
{
|
{
|
||||||
list.Add(typeof(MusicArtist).FullName);
|
list.Add(typeof(MusicArtist).FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsTypeInQuery(nameof(Studio), query))
|
if (IsTypeInQuery(BaseItemKind.Studio, query))
|
||||||
{
|
{
|
||||||
list.Add(typeof(Studio).FullName);
|
list.Add(typeof(Studio).FullName);
|
||||||
}
|
}
|
||||||
|
@ -4789,14 +4788,14 @@ namespace Emby.Server.Implementations.Data
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsTypeInQuery(string type, InternalItemsQuery query)
|
private bool IsTypeInQuery(BaseItemKind type, InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (query.ExcludeItemTypes.Contains(type, StringComparer.OrdinalIgnoreCase))
|
if (query.ExcludeItemTypes.Contains(type))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return query.IncludeItemTypes.Length == 0 || query.IncludeItemTypes.Contains(type, StringComparer.OrdinalIgnoreCase);
|
return query.IncludeItemTypes.Length == 0 || query.IncludeItemTypes.Contains(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetCleanValue(string value)
|
private string GetCleanValue(string value)
|
||||||
|
@ -4836,12 +4835,12 @@ namespace Emby.Server.Implementations.Data
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.IncludeItemTypes.Contains(nameof(Episode), StringComparer.OrdinalIgnoreCase)
|
if (query.IncludeItemTypes.Contains(BaseItemKind.Episode)
|
||||||
|| query.IncludeItemTypes.Contains(nameof(Video), StringComparer.OrdinalIgnoreCase)
|
|| query.IncludeItemTypes.Contains(BaseItemKind.Video)
|
||||||
|| query.IncludeItemTypes.Contains(nameof(Movie), StringComparer.OrdinalIgnoreCase)
|
|| query.IncludeItemTypes.Contains(BaseItemKind.Movie)
|
||||||
|| query.IncludeItemTypes.Contains(nameof(MusicVideo), StringComparer.OrdinalIgnoreCase)
|
|| query.IncludeItemTypes.Contains(BaseItemKind.MusicVideo)
|
||||||
|| query.IncludeItemTypes.Contains(nameof(Series), StringComparer.OrdinalIgnoreCase)
|
|| query.IncludeItemTypes.Contains(BaseItemKind.Series)
|
||||||
|| query.IncludeItemTypes.Contains(nameof(Season), StringComparer.OrdinalIgnoreCase))
|
|| query.IncludeItemTypes.Contains(BaseItemKind.Season))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -4890,22 +4889,6 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string MapIncludeItemTypes(string value)
|
|
||||||
{
|
|
||||||
if (_types.TryGetValue(value, out string result))
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsValidType(value))
|
|
||||||
{
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.LogWarning("Unknown item type: {ItemType}", value);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteItem(Guid id)
|
public void DeleteItem(Guid id)
|
||||||
{
|
{
|
||||||
if (id == Guid.Empty)
|
if (id == Guid.Empty)
|
||||||
|
@ -5569,7 +5552,7 @@ AND Type = @InternalPersonType)");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ItemCounts GetItemCounts(IReadOnlyList<ResultSetValue> reader, int countStartColumn, string[] typesToCount)
|
private static ItemCounts GetItemCounts(IReadOnlyList<ResultSetValue> reader, int countStartColumn, BaseItemKind[] typesToCount)
|
||||||
{
|
{
|
||||||
var counts = new ItemCounts();
|
var counts = new ItemCounts();
|
||||||
|
|
||||||
|
|
|
@ -470,7 +470,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
{
|
{
|
||||||
var parentAlbumIds = _libraryManager.GetItemIds(new InternalItemsQuery
|
var parentAlbumIds = _libraryManager.GetItemIds(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(MusicAlbum) },
|
IncludeItemTypes = new[] { BaseItemKind.MusicAlbum },
|
||||||
Name = item.Album,
|
Name = item.Album,
|
||||||
Limit = 1
|
Limit = 1
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,35 +28,35 @@ namespace Emby.Server.Implementations.Images
|
||||||
var view = (CollectionFolder)item;
|
var view = (CollectionFolder)item;
|
||||||
var viewType = view.CollectionType;
|
var viewType = view.CollectionType;
|
||||||
|
|
||||||
string[] includeItemTypes;
|
BaseItemKind[] includeItemTypes;
|
||||||
|
|
||||||
if (string.Equals(viewType, CollectionType.Movies, StringComparison.Ordinal))
|
if (string.Equals(viewType, CollectionType.Movies, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "Movie" };
|
includeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
}
|
}
|
||||||
else if (string.Equals(viewType, CollectionType.TvShows, StringComparison.Ordinal))
|
else if (string.Equals(viewType, CollectionType.TvShows, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "Series" };
|
includeItemTypes = new[] { BaseItemKind.Series };
|
||||||
}
|
}
|
||||||
else if (string.Equals(viewType, CollectionType.Music, StringComparison.Ordinal))
|
else if (string.Equals(viewType, CollectionType.Music, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "MusicAlbum" };
|
includeItemTypes = new[] { BaseItemKind.MusicAlbum };
|
||||||
}
|
}
|
||||||
else if (string.Equals(viewType, CollectionType.Books, StringComparison.Ordinal))
|
else if (string.Equals(viewType, CollectionType.Books, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "Book", "AudioBook" };
|
includeItemTypes = new[] { BaseItemKind.Book, BaseItemKind.AudioBook };
|
||||||
}
|
}
|
||||||
else if (string.Equals(viewType, CollectionType.BoxSets, StringComparison.Ordinal))
|
else if (string.Equals(viewType, CollectionType.BoxSets, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "BoxSet" };
|
includeItemTypes = new[] { BaseItemKind.BoxSet };
|
||||||
}
|
}
|
||||||
else if (string.Equals(viewType, CollectionType.HomeVideos, StringComparison.Ordinal) || string.Equals(viewType, CollectionType.Photos, StringComparison.Ordinal))
|
else if (string.Equals(viewType, CollectionType.HomeVideos, StringComparison.Ordinal) || string.Equals(viewType, CollectionType.Photos, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "Video", "Photo" };
|
includeItemTypes = new[] { BaseItemKind.Video, BaseItemKind.Photo };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "Video", "Audio", "Photo", "Movie", "Series" };
|
includeItemTypes = new[] { BaseItemKind.Video, BaseItemKind.Audio, BaseItemKind.Photo, BaseItemKind.Movie, BaseItemKind.Series };
|
||||||
}
|
}
|
||||||
|
|
||||||
var recursive = !string.Equals(CollectionType.Playlists, viewType, StringComparison.OrdinalIgnoreCase);
|
var recursive = !string.Equals(CollectionType.Playlists, viewType, StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Controller.Drawing;
|
using MediaBrowser.Controller.Drawing;
|
||||||
using MediaBrowser.Controller.Dto;
|
using MediaBrowser.Controller.Dto;
|
||||||
|
@ -41,7 +42,7 @@ namespace Emby.Server.Implementations.Images
|
||||||
User = view.UserId.HasValue ? _userManager.GetUserById(view.UserId.Value) : null,
|
User = view.UserId.HasValue ? _userManager.GetUserById(view.UserId.Value) : null,
|
||||||
CollapseBoxSetItems = false,
|
CollapseBoxSetItems = false,
|
||||||
Recursive = recursive,
|
Recursive = recursive,
|
||||||
ExcludeItemTypes = new[] { "UserView", "CollectionFolder", "Person" },
|
ExcludeItemTypes = new[] { BaseItemKind.UserView, BaseItemKind.CollectionFolder, BaseItemKind.Person },
|
||||||
DtoOptions = new DtoOptions(false)
|
DtoOptions = new DtoOptions(false)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace Emby.Server.Implementations.Images
|
||||||
return _libraryManager.GetItemList(new InternalItemsQuery
|
return _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
Genres = new[] { item.Name },
|
Genres = new[] { item.Name },
|
||||||
IncludeItemTypes = new[] { nameof(Series), nameof(Movie) },
|
IncludeItemTypes = new[] { BaseItemKind.Series, BaseItemKind.Movie },
|
||||||
OrderBy = new[] { (ItemSortBy.Random, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.Random, SortOrder.Ascending) },
|
||||||
Limit = 4,
|
Limit = 4,
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
|
|
|
@ -44,9 +44,9 @@ namespace Emby.Server.Implementations.Images
|
||||||
Genres = new[] { item.Name },
|
Genres = new[] { item.Name },
|
||||||
IncludeItemTypes = new[]
|
IncludeItemTypes = new[]
|
||||||
{
|
{
|
||||||
nameof(MusicAlbum),
|
BaseItemKind.MusicAlbum,
|
||||||
nameof(MusicVideo),
|
BaseItemKind.MusicVideo,
|
||||||
nameof(Audio)
|
BaseItemKind.Audio
|
||||||
},
|
},
|
||||||
OrderBy = new[] { (ItemSortBy.Random, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.Random, SortOrder.Ascending) },
|
||||||
Limit = 4,
|
Limit = 4,
|
||||||
|
|
|
@ -965,7 +965,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
{
|
{
|
||||||
var existing = GetItemList(new InternalItemsQuery
|
var existing = GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(MusicArtist) },
|
IncludeItemTypes = new[] { BaseItemKind.MusicArtist },
|
||||||
Name = name,
|
Name = name,
|
||||||
DtoOptions = options
|
DtoOptions = options
|
||||||
}).Cast<MusicArtist>()
|
}).Cast<MusicArtist>()
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
var genres = item
|
var genres = item
|
||||||
.GetRecursiveChildren(user, new InternalItemsQuery(user)
|
.GetRecursiveChildren(user, new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Audio) },
|
IncludeItemTypes = new[] { BaseItemKind.Audio },
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
})
|
})
|
||||||
.Cast<Audio>()
|
.Cast<Audio>()
|
||||||
|
@ -89,7 +89,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
{
|
{
|
||||||
return _libraryManager.GetItemList(new InternalItemsQuery(user)
|
return _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Audio) },
|
IncludeItemTypes = new[] { BaseItemKind.Audio },
|
||||||
|
|
||||||
GenreIds = genreIds.ToArray(),
|
GenreIds = genreIds.ToArray(),
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ namespace Emby.Server.Implementations.Library
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AddIfMissing(List<string> list, string value)
|
private static void AddIfMissing(List<BaseItemKind> list, BaseItemKind value)
|
||||||
{
|
{
|
||||||
if (!list.Contains(value, StringComparer.OrdinalIgnoreCase))
|
if (!list.Contains(value))
|
||||||
{
|
{
|
||||||
list.Add(value);
|
list.Add(value);
|
||||||
}
|
}
|
||||||
|
@ -86,63 +86,63 @@ namespace Emby.Server.Implementations.Library
|
||||||
searchTerm = searchTerm.Trim().RemoveDiacritics();
|
searchTerm = searchTerm.Trim().RemoveDiacritics();
|
||||||
|
|
||||||
var excludeItemTypes = query.ExcludeItemTypes.ToList();
|
var excludeItemTypes = query.ExcludeItemTypes.ToList();
|
||||||
var includeItemTypes = (query.IncludeItemTypes ?? Array.Empty<string>()).ToList();
|
var includeItemTypes = (query.IncludeItemTypes ?? Array.Empty<BaseItemKind>()).ToList();
|
||||||
|
|
||||||
excludeItemTypes.Add(nameof(Year));
|
excludeItemTypes.Add(BaseItemKind.Year);
|
||||||
excludeItemTypes.Add(nameof(Folder));
|
excludeItemTypes.Add(BaseItemKind.Folder);
|
||||||
|
|
||||||
if (query.IncludeGenres && (includeItemTypes.Count == 0 || includeItemTypes.Contains("Genre", StringComparer.OrdinalIgnoreCase)))
|
if (query.IncludeGenres && (includeItemTypes.Count == 0 || includeItemTypes.Contains(BaseItemKind.Genre)))
|
||||||
{
|
{
|
||||||
if (!query.IncludeMedia)
|
if (!query.IncludeMedia)
|
||||||
{
|
{
|
||||||
AddIfMissing(includeItemTypes, nameof(Genre));
|
AddIfMissing(includeItemTypes, BaseItemKind.Genre);
|
||||||
AddIfMissing(includeItemTypes, nameof(MusicGenre));
|
AddIfMissing(includeItemTypes, BaseItemKind.MusicGenre);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddIfMissing(excludeItemTypes, nameof(Genre));
|
AddIfMissing(excludeItemTypes, BaseItemKind.Genre);
|
||||||
AddIfMissing(excludeItemTypes, nameof(MusicGenre));
|
AddIfMissing(excludeItemTypes, BaseItemKind.MusicGenre);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.IncludePeople && (includeItemTypes.Count == 0 || includeItemTypes.Contains("People", StringComparer.OrdinalIgnoreCase) || includeItemTypes.Contains("Person", StringComparer.OrdinalIgnoreCase)))
|
if (query.IncludePeople && (includeItemTypes.Count == 0 || includeItemTypes.Contains(BaseItemKind.Person)))
|
||||||
{
|
{
|
||||||
if (!query.IncludeMedia)
|
if (!query.IncludeMedia)
|
||||||
{
|
{
|
||||||
AddIfMissing(includeItemTypes, nameof(Person));
|
AddIfMissing(includeItemTypes, BaseItemKind.Person);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddIfMissing(excludeItemTypes, nameof(Person));
|
AddIfMissing(excludeItemTypes, BaseItemKind.Person);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.IncludeStudios && (includeItemTypes.Count == 0 || includeItemTypes.Contains("Studio", StringComparer.OrdinalIgnoreCase)))
|
if (query.IncludeStudios && (includeItemTypes.Count == 0 || includeItemTypes.Contains(BaseItemKind.Studio)))
|
||||||
{
|
{
|
||||||
if (!query.IncludeMedia)
|
if (!query.IncludeMedia)
|
||||||
{
|
{
|
||||||
AddIfMissing(includeItemTypes, nameof(Studio));
|
AddIfMissing(includeItemTypes, BaseItemKind.Studio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddIfMissing(excludeItemTypes, nameof(Studio));
|
AddIfMissing(excludeItemTypes, BaseItemKind.Studio);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.IncludeArtists && (includeItemTypes.Count == 0 || includeItemTypes.Contains("MusicArtist", StringComparer.OrdinalIgnoreCase)))
|
if (query.IncludeArtists && (includeItemTypes.Count == 0 || includeItemTypes.Contains(BaseItemKind.MusicArtist)))
|
||||||
{
|
{
|
||||||
if (!query.IncludeMedia)
|
if (!query.IncludeMedia)
|
||||||
{
|
{
|
||||||
AddIfMissing(includeItemTypes, nameof(MusicArtist));
|
AddIfMissing(includeItemTypes, BaseItemKind.MusicArtist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddIfMissing(excludeItemTypes, nameof(MusicArtist));
|
AddIfMissing(excludeItemTypes, BaseItemKind.MusicArtist);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddIfMissing(excludeItemTypes, nameof(CollectionFolder));
|
AddIfMissing(excludeItemTypes, BaseItemKind.CollectionFolder);
|
||||||
AddIfMissing(excludeItemTypes, nameof(Folder));
|
AddIfMissing(excludeItemTypes, BaseItemKind.Folder);
|
||||||
var mediaTypes = query.MediaTypes.ToList();
|
var mediaTypes = query.MediaTypes.ToList();
|
||||||
|
|
||||||
if (includeItemTypes.Count > 0)
|
if (includeItemTypes.Count > 0)
|
||||||
|
@ -183,7 +183,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
|
|
||||||
List<BaseItem> mediaItems;
|
List<BaseItem> mediaItems;
|
||||||
|
|
||||||
if (searchQuery.IncludeItemTypes.Length == 1 && string.Equals(searchQuery.IncludeItemTypes[0], "MusicArtist", StringComparison.OrdinalIgnoreCase))
|
if (searchQuery.IncludeItemTypes.Length == 1 && searchQuery.IncludeItemTypes[0] == BaseItemKind.MusicArtist)
|
||||||
{
|
{
|
||||||
if (!searchQuery.ParentId.Equals(Guid.Empty))
|
if (!searchQuery.ParentId.Equals(Guid.Empty))
|
||||||
{
|
{
|
||||||
|
@ -192,7 +192,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
|
|
||||||
searchQuery.ParentId = Guid.Empty;
|
searchQuery.ParentId = Guid.Empty;
|
||||||
searchQuery.IncludeItemsByName = true;
|
searchQuery.IncludeItemsByName = true;
|
||||||
searchQuery.IncludeItemTypes = Array.Empty<string>();
|
searchQuery.IncludeItemTypes = Array.Empty<BaseItemKind>();
|
||||||
mediaItems = _libraryManager.GetAllArtists(searchQuery).Items.Select(i => i.Item1).ToList();
|
mediaItems = _libraryManager.GetAllArtists(searchQuery).Items.Select(i => i.Item1).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -300,11 +300,11 @@ namespace Emby.Server.Implementations.Library
|
||||||
{
|
{
|
||||||
if (hasCollectionType.All(i => string.Equals(i.CollectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase)))
|
if (hasCollectionType.All(i => string.Equals(i.CollectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase)))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "Movie" };
|
includeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
}
|
}
|
||||||
else if (hasCollectionType.All(i => string.Equals(i.CollectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)))
|
else if (hasCollectionType.All(i => string.Equals(i.CollectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase)))
|
||||||
{
|
{
|
||||||
includeItemTypes = new string[] { "Episode" };
|
includeItemTypes = new[] { BaseItemKind.Episode };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -344,13 +344,13 @@ namespace Emby.Server.Implementations.Library
|
||||||
var excludeItemTypes = includeItemTypes.Length == 0 && mediaTypes.Count == 0
|
var excludeItemTypes = includeItemTypes.Length == 0 && mediaTypes.Count == 0
|
||||||
? new[]
|
? new[]
|
||||||
{
|
{
|
||||||
nameof(Person),
|
BaseItemKind.Person,
|
||||||
nameof(Studio),
|
BaseItemKind.Studio,
|
||||||
nameof(Year),
|
BaseItemKind.Year,
|
||||||
nameof(MusicGenre),
|
BaseItemKind.MusicGenre,
|
||||||
nameof(Genre)
|
BaseItemKind.Genre
|
||||||
}
|
}
|
||||||
: Array.Empty<string>();
|
: Array.Empty<BaseItemKind>();
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.Audio;
|
using MediaBrowser.Controller.Entities.Audio;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
|
@ -81,7 +82,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
||||||
|
|
||||||
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(MusicArtist) },
|
IncludeItemTypes = new[] { BaseItemKind.MusicArtist },
|
||||||
IsDeadArtist = true,
|
IsDeadArtist = true,
|
||||||
IsLocked = false
|
IsLocked = false
|
||||||
}).Cast<MusicArtist>().ToList();
|
}).Cast<MusicArtist>().ToList();
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
||||||
var movies = _libraryManager.GetItemList(new InternalItemsQuery
|
var movies = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
MediaTypes = new string[] { MediaType.Video },
|
MediaTypes = new string[] { MediaType.Video },
|
||||||
IncludeItemTypes = new[] { nameof(Movie) },
|
IncludeItemTypes = new[] { BaseItemKind.Movie },
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
Parent = library,
|
Parent = library,
|
||||||
|
@ -108,7 +108,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
||||||
|
|
||||||
var boxSets = _libraryManager.GetItemList(new InternalItemsQuery
|
var boxSets = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(BoxSet) },
|
IncludeItemTypes = new[] { BaseItemKind.BoxSet },
|
||||||
CollapseBoxSetItems = false,
|
CollapseBoxSetItems = false,
|
||||||
Recursive = true
|
Recursive = true
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
|
@ -91,7 +92,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
||||||
|
|
||||||
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Person) },
|
IncludeItemTypes = new[] { BaseItemKind.Person },
|
||||||
IsDeadPerson = true,
|
IsDeadPerson = true,
|
||||||
IsLocked = false
|
IsLocked = false
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
|
@ -80,7 +81,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
||||||
|
|
||||||
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
var deadEntities = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Studio) },
|
IncludeItemTypes = new[] { BaseItemKind.Studio },
|
||||||
IsDeadStudio = true,
|
IsDeadStudio = true,
|
||||||
IsLocked = false
|
IsLocked = false
|
||||||
});
|
});
|
||||||
|
|
|
@ -1778,7 +1778,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||||
{
|
{
|
||||||
var program = string.IsNullOrWhiteSpace(timer.ProgramId) ? null : _libraryManager.GetItemList(new InternalItemsQuery
|
var program = string.IsNullOrWhiteSpace(timer.ProgramId) ? null : _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
ExternalId = timer.ProgramId,
|
ExternalId = timer.ProgramId,
|
||||||
DtoOptions = new DtoOptions(true)
|
DtoOptions = new DtoOptions(true)
|
||||||
|
@ -2137,7 +2137,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||||
{
|
{
|
||||||
var query = new InternalItemsQuery
|
var query = new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
DtoOptions = new DtoOptions(true)
|
DtoOptions = new DtoOptions(true)
|
||||||
{
|
{
|
||||||
|
@ -2352,7 +2352,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||||
|
|
||||||
var query = new InternalItemsQuery
|
var query = new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
ExternalSeriesId = seriesTimer.SeriesId,
|
ExternalSeriesId = seriesTimer.SeriesId,
|
||||||
DtoOptions = new DtoOptions(true)
|
DtoOptions = new DtoOptions(true)
|
||||||
{
|
{
|
||||||
|
@ -2387,7 +2387,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||||
channel = _libraryManager.GetItemList(
|
channel = _libraryManager.GetItemList(
|
||||||
new InternalItemsQuery
|
new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(LiveTvChannel) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvChannel },
|
||||||
ItemIds = new[] { parent.ChannelId },
|
ItemIds = new[] { parent.ChannelId },
|
||||||
DtoOptions = new DtoOptions()
|
DtoOptions = new DtoOptions()
|
||||||
}).FirstOrDefault() as LiveTvChannel;
|
}).FirstOrDefault() as LiveTvChannel;
|
||||||
|
@ -2446,7 +2446,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||||
channel = _libraryManager.GetItemList(
|
channel = _libraryManager.GetItemList(
|
||||||
new InternalItemsQuery
|
new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(LiveTvChannel) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvChannel },
|
||||||
ItemIds = new[] { programInfo.ChannelId },
|
ItemIds = new[] { programInfo.ChannelId },
|
||||||
DtoOptions = new DtoOptions()
|
DtoOptions = new DtoOptions()
|
||||||
}).FirstOrDefault() as LiveTvChannel;
|
}).FirstOrDefault() as LiveTvChannel;
|
||||||
|
@ -2511,7 +2511,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||||
var seriesIds = _libraryManager.GetItemIds(
|
var seriesIds = _libraryManager.GetItemIds(
|
||||||
new InternalItemsQuery
|
new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Series) },
|
IncludeItemTypes = new[] { BaseItemKind.Series },
|
||||||
Name = program.Name
|
Name = program.Name
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
|
|
||||||
|
@ -2524,7 +2524,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||||
{
|
{
|
||||||
var result = _libraryManager.GetItemIds(new InternalItemsQuery
|
var result = _libraryManager.GetItemIds(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Episode) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode },
|
||||||
ParentIndexNumber = program.SeasonNumber.Value,
|
ParentIndexNumber = program.SeasonNumber.Value,
|
||||||
IndexNumber = program.EpisodeNumber.Value,
|
IndexNumber = program.EpisodeNumber.Value,
|
||||||
AncestorIds = seriesIds,
|
AncestorIds = seriesIds,
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Common;
|
using MediaBrowser.Common;
|
||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Controller.Drawing;
|
using MediaBrowser.Controller.Drawing;
|
||||||
|
@ -161,7 +162,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
var librarySeries = _libraryManager.GetItemList(new InternalItemsQuery
|
var librarySeries = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(Series) },
|
IncludeItemTypes = new[] { BaseItemKind.Series },
|
||||||
Name = seriesName,
|
Name = seriesName,
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
ImageTypes = new ImageType[] { ImageType.Thumb },
|
ImageTypes = new ImageType[] { ImageType.Thumb },
|
||||||
|
@ -204,7 +205,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
|
|
||||||
var program = _libraryManager.GetItemList(new InternalItemsQuery
|
var program = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
ExternalSeriesId = programSeriesId,
|
ExternalSeriesId = programSeriesId,
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
ImageTypes = new ImageType[] { ImageType.Primary },
|
ImageTypes = new ImageType[] { ImageType.Primary },
|
||||||
|
@ -255,7 +256,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
var librarySeries = _libraryManager.GetItemList(new InternalItemsQuery
|
var librarySeries = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(Series) },
|
IncludeItemTypes = new[] { BaseItemKind.Series },
|
||||||
Name = seriesName,
|
Name = seriesName,
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
ImageTypes = new ImageType[] { ImageType.Thumb },
|
ImageTypes = new ImageType[] { ImageType.Thumb },
|
||||||
|
@ -298,7 +299,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
|
|
||||||
var program = _libraryManager.GetItemList(new InternalItemsQuery
|
var program = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(Series) },
|
IncludeItemTypes = new[] { BaseItemKind.Series },
|
||||||
Name = seriesName,
|
Name = seriesName,
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
ImageTypes = new ImageType[] { ImageType.Primary },
|
ImageTypes = new ImageType[] { ImageType.Primary },
|
||||||
|
@ -309,7 +310,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
program = _libraryManager.GetItemList(new InternalItemsQuery
|
program = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
ExternalSeriesId = programSeriesId,
|
ExternalSeriesId = programSeriesId,
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
ImageTypes = new ImageType[] { ImageType.Primary },
|
ImageTypes = new ImageType[] { ImageType.Primary },
|
||||||
|
|
|
@ -191,7 +191,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
IsKids = query.IsKids,
|
IsKids = query.IsKids,
|
||||||
IsSports = query.IsSports,
|
IsSports = query.IsSports,
|
||||||
IsSeries = query.IsSeries,
|
IsSeries = query.IsSeries,
|
||||||
IncludeItemTypes = new[] { nameof(LiveTvChannel) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvChannel },
|
||||||
TopParentIds = new[] { topFolder.Id },
|
TopParentIds = new[] { topFolder.Id },
|
||||||
IsFavorite = query.IsFavorite,
|
IsFavorite = query.IsFavorite,
|
||||||
IsLiked = query.IsLiked,
|
IsLiked = query.IsLiked,
|
||||||
|
@ -810,7 +810,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
|
|
||||||
var internalQuery = new InternalItemsQuery(user)
|
var internalQuery = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
MinEndDate = query.MinEndDate,
|
MinEndDate = query.MinEndDate,
|
||||||
MinStartDate = query.MinStartDate,
|
MinStartDate = query.MinStartDate,
|
||||||
MaxEndDate = query.MaxEndDate,
|
MaxEndDate = query.MaxEndDate,
|
||||||
|
@ -874,7 +874,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
|
|
||||||
var internalQuery = new InternalItemsQuery(user)
|
var internalQuery = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
IsAiring = query.IsAiring,
|
IsAiring = query.IsAiring,
|
||||||
HasAired = query.HasAired,
|
HasAired = query.HasAired,
|
||||||
IsNews = query.IsNews,
|
IsNews = query.IsNews,
|
||||||
|
@ -1085,8 +1085,8 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
|
|
||||||
if (cleanDatabase)
|
if (cleanDatabase)
|
||||||
{
|
{
|
||||||
CleanDatabaseInternal(newChannelIdList.ToArray(), new[] { nameof(LiveTvChannel) }, progress, cancellationToken);
|
CleanDatabaseInternal(newChannelIdList.ToArray(), new[] { BaseItemKind.LiveTvChannel }, progress, cancellationToken);
|
||||||
CleanDatabaseInternal(newProgramIdList.ToArray(), new[] { nameof(LiveTvProgram) }, progress, cancellationToken);
|
CleanDatabaseInternal(newProgramIdList.ToArray(), new[] { BaseItemKind.LiveTvProgram }, progress, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
var coreService = _services.OfType<EmbyTV.EmbyTV>().FirstOrDefault();
|
var coreService = _services.OfType<EmbyTV.EmbyTV>().FirstOrDefault();
|
||||||
|
@ -1177,7 +1177,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
|
|
||||||
var existingPrograms = _libraryManager.GetItemList(new InternalItemsQuery
|
var existingPrograms = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new string[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
ChannelIds = new Guid[] { currentChannel.Id },
|
ChannelIds = new Guid[] { currentChannel.Id },
|
||||||
DtoOptions = new DtoOptions(true)
|
DtoOptions = new DtoOptions(true)
|
||||||
}).Cast<LiveTvProgram>().ToDictionary(i => i.Id);
|
}).Cast<LiveTvProgram>().ToDictionary(i => i.Id);
|
||||||
|
@ -1261,7 +1261,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
return new Tuple<List<Guid>, List<Guid>>(channels, programs);
|
return new Tuple<List<Guid>, List<Guid>>(channels, programs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CleanDatabaseInternal(Guid[] currentIdList, string[] validTypes, IProgress<double> progress, CancellationToken cancellationToken)
|
private void CleanDatabaseInternal(Guid[] currentIdList, BaseItemKind[] validTypes, IProgress<double> progress, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var list = _itemRepo.GetItemIdsList(new InternalItemsQuery
|
var list = _itemRepo.GetItemIdsList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
|
@ -1328,25 +1328,25 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
.Select(i => i.Id)
|
.Select(i => i.Id)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var excludeItemTypes = new List<string>();
|
var excludeItemTypes = new List<BaseItemKind>();
|
||||||
|
|
||||||
if (folderIds.Count == 0)
|
if (folderIds.Count == 0)
|
||||||
{
|
{
|
||||||
return new QueryResult<BaseItem>();
|
return new QueryResult<BaseItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
var includeItemTypes = new List<string>();
|
var includeItemTypes = new List<BaseItemKind>();
|
||||||
var genres = new List<string>();
|
var genres = new List<string>();
|
||||||
|
|
||||||
if (query.IsMovie.HasValue)
|
if (query.IsMovie.HasValue)
|
||||||
{
|
{
|
||||||
if (query.IsMovie.Value)
|
if (query.IsMovie.Value)
|
||||||
{
|
{
|
||||||
includeItemTypes.Add(nameof(Movie));
|
includeItemTypes.Add(BaseItemKind.Movie);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
excludeItemTypes.Add(nameof(Movie));
|
excludeItemTypes.Add(BaseItemKind.Movie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1354,11 +1354,11 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
if (query.IsSeries.Value)
|
if (query.IsSeries.Value)
|
||||||
{
|
{
|
||||||
includeItemTypes.Add(nameof(Episode));
|
includeItemTypes.Add(BaseItemKind.Episode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
excludeItemTypes.Add(nameof(Episode));
|
excludeItemTypes.Add(BaseItemKind.Episode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1878,7 +1878,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
|
|
||||||
var programs = options.AddCurrentProgram ? _libraryManager.GetItemList(new InternalItemsQuery(user)
|
var programs = options.AddCurrentProgram ? _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(LiveTvProgram) },
|
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
||||||
ChannelIds = channelIds,
|
ChannelIds = channelIds,
|
||||||
MaxStartDate = now,
|
MaxStartDate = now,
|
||||||
MinEndDate = now,
|
MinEndDate = now,
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Jellyfin.Data.Entities;
|
using Jellyfin.Data.Entities;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Playlists;
|
using MediaBrowser.Controller.Playlists;
|
||||||
using MediaBrowser.Model.Querying;
|
using MediaBrowser.Model.Querying;
|
||||||
|
@ -45,7 +46,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||||
}
|
}
|
||||||
|
|
||||||
query.Recursive = true;
|
query.Recursive = true;
|
||||||
query.IncludeItemTypes = new[] { "Playlist" };
|
query.IncludeItemTypes = new[] { BaseItemKind.Playlist };
|
||||||
query.Parent = null;
|
query.Parent = null;
|
||||||
return LibraryManager.GetItemsResult(query);
|
return LibraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1292,7 +1292,7 @@ namespace Emby.Server.Implementations.Session
|
||||||
{
|
{
|
||||||
["ItemId"] = command.ItemId,
|
["ItemId"] = command.ItemId,
|
||||||
["ItemName"] = command.ItemName,
|
["ItemName"] = command.ItemName,
|
||||||
["ItemType"] = command.ItemType
|
["ItemType"] = command.ItemType.ToString()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ namespace Emby.Server.Implementations.TV
|
||||||
.GetItemList(
|
.GetItemList(
|
||||||
new InternalItemsQuery(user)
|
new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Episode) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode },
|
||||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DatePlayed, SortOrder.Descending) },
|
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DatePlayed, SortOrder.Descending) },
|
||||||
SeriesPresentationUniqueKey = presentationUniqueKey,
|
SeriesPresentationUniqueKey = presentationUniqueKey,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
|
@ -191,7 +191,7 @@ namespace Emby.Server.Implementations.TV
|
||||||
{
|
{
|
||||||
AncestorWithPresentationUniqueKey = null,
|
AncestorWithPresentationUniqueKey = null,
|
||||||
SeriesPresentationUniqueKey = seriesKey,
|
SeriesPresentationUniqueKey = seriesKey,
|
||||||
IncludeItemTypes = new[] { nameof(Episode) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode },
|
||||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Descending) },
|
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Descending) },
|
||||||
IsPlayed = true,
|
IsPlayed = true,
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
|
@ -209,7 +209,7 @@ namespace Emby.Server.Implementations.TV
|
||||||
{
|
{
|
||||||
AncestorWithPresentationUniqueKey = null,
|
AncestorWithPresentationUniqueKey = null,
|
||||||
SeriesPresentationUniqueKey = seriesKey,
|
SeriesPresentationUniqueKey = seriesKey,
|
||||||
IncludeItemTypes = new[] { nameof(Episode) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode },
|
||||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
IsPlayed = false,
|
IsPlayed = false,
|
||||||
|
@ -226,7 +226,7 @@ namespace Emby.Server.Implementations.TV
|
||||||
AncestorWithPresentationUniqueKey = null,
|
AncestorWithPresentationUniqueKey = null,
|
||||||
SeriesPresentationUniqueKey = seriesKey,
|
SeriesPresentationUniqueKey = seriesKey,
|
||||||
ParentIndexNumber = 0,
|
ParentIndexNumber = 0,
|
||||||
IncludeItemTypes = new[] { nameof(Episode) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode },
|
||||||
IsPlayed = false,
|
IsPlayed = false,
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
|
|
|
@ -133,8 +133,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
|
@ -337,8 +337,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
User = user,
|
User = user,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
EnableTotalRecordCount = false,
|
EnableTotalRecordCount = false,
|
||||||
DtoOptions = new DtoOptions
|
DtoOptions = new DtoOptions
|
||||||
|
@ -166,7 +166,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
var filters = new QueryFilters();
|
var filters = new QueryFilters();
|
||||||
var genreQuery = new InternalItemsQuery(user)
|
var genreQuery = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
DtoOptions = new DtoOptions
|
DtoOptions = new DtoOptions
|
||||||
{
|
{
|
||||||
Fields = Array.Empty<ItemFields>(),
|
Fields = Array.Empty<ItemFields>(),
|
||||||
|
|
|
@ -101,8 +101,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
IsFavorite = isFavorite,
|
IsFavorite = isFavorite,
|
||||||
|
@ -160,7 +160,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
Genre item = new Genre();
|
Genre item = new Genre();
|
||||||
if (genreName.IndexOf(BaseItem.SlugChar, StringComparison.OrdinalIgnoreCase) != -1)
|
if (genreName.IndexOf(BaseItem.SlugChar, StringComparison.OrdinalIgnoreCase) != -1)
|
||||||
{
|
{
|
||||||
var result = GetItemFromSlugName<Genre>(_libraryManager, genreName, dtoOptions);
|
var result = GetItemFromSlugName<Genre>(_libraryManager, genreName, dtoOptions, BaseItemKind.Genre);
|
||||||
|
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
|
@ -182,27 +182,27 @@ namespace Jellyfin.Api.Controllers
|
||||||
return _dtoService.GetBaseItemDto(item, dtoOptions);
|
return _dtoService.GetBaseItemDto(item, dtoOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
private T? GetItemFromSlugName<T>(ILibraryManager libraryManager, string name, DtoOptions dtoOptions)
|
private T? GetItemFromSlugName<T>(ILibraryManager libraryManager, string name, DtoOptions dtoOptions, BaseItemKind baseItemKind)
|
||||||
where T : BaseItem, new()
|
where T : BaseItem, new()
|
||||||
{
|
{
|
||||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
Name = name.Replace(BaseItem.SlugChar, '&'),
|
Name = name.Replace(BaseItem.SlugChar, '&'),
|
||||||
IncludeItemTypes = new[] { typeof(T).Name },
|
IncludeItemTypes = new[] { baseItemKind },
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
}).OfType<T>().FirstOrDefault();
|
}).OfType<T>().FirstOrDefault();
|
||||||
|
|
||||||
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
Name = name.Replace(BaseItem.SlugChar, '/'),
|
Name = name.Replace(BaseItem.SlugChar, '/'),
|
||||||
IncludeItemTypes = new[] { typeof(T).Name },
|
IncludeItemTypes = new[] { baseItemKind },
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
}).OfType<T>().FirstOrDefault();
|
}).OfType<T>().FirstOrDefault();
|
||||||
|
|
||||||
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
Name = name.Replace(BaseItem.SlugChar, '?'),
|
Name = name.Replace(BaseItem.SlugChar, '?'),
|
||||||
IncludeItemTypes = new[] { typeof(T).Name },
|
IncludeItemTypes = new[] { baseItemKind },
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
}).OfType<T>().FirstOrDefault();
|
}).OfType<T>().FirstOrDefault();
|
||||||
|
|
||||||
|
|
|
@ -296,8 +296,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
IsPlayed = isPlayed,
|
IsPlayed = isPlayed,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
Recursive = recursive ?? false,
|
Recursive = recursive ?? false,
|
||||||
OrderBy = RequestHelpers.GetOrderBy(sortBy, sortOrder),
|
OrderBy = RequestHelpers.GetOrderBy(sortBy, sortOrder),
|
||||||
IsFavorite = isFavorite,
|
IsFavorite = isFavorite,
|
||||||
|
@ -459,7 +459,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
query.AlbumIds = albums.SelectMany(i =>
|
query.AlbumIds = albums.SelectMany(i =>
|
||||||
{
|
{
|
||||||
return _libraryManager.GetItemIds(new InternalItemsQuery { IncludeItemTypes = new[] { nameof(MusicAlbum) }, Name = i, Limit = 1 });
|
return _libraryManager.GetItemIds(new InternalItemsQuery { IncludeItemTypes = new[] { BaseItemKind.MusicAlbum }, Name = i, Limit = 1 });
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,7 +483,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
if (query.OrderBy.Count == 0)
|
if (query.OrderBy.Count == 0)
|
||||||
{
|
{
|
||||||
// Albums by artist
|
// Albums by artist
|
||||||
if (query.ArtistIds.Length > 0 && query.IncludeItemTypes.Length == 1 && string.Equals(query.IncludeItemTypes[0], "MusicAlbum", StringComparison.OrdinalIgnoreCase))
|
if (query.ArtistIds.Length > 0 && query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes[0] == BaseItemKind.MusicAlbum)
|
||||||
{
|
{
|
||||||
query.OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.ProductionYear, SortOrder.Descending), new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending) };
|
query.OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.ProductionYear, SortOrder.Descending), new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending) };
|
||||||
}
|
}
|
||||||
|
@ -831,8 +831,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
CollapseBoxSetItems = false,
|
CollapseBoxSetItems = false,
|
||||||
EnableTotalRecordCount = enableTotalRecordCount,
|
EnableTotalRecordCount = enableTotalRecordCount,
|
||||||
AncestorIds = ancestorIds,
|
AncestorIds = ancestorIds,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
SearchTerm = searchTerm,
|
SearchTerm = searchTerm,
|
||||||
ExcludeItemIds = excludeItemIds
|
ExcludeItemIds = excludeItemIds
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,6 +14,7 @@ using Jellyfin.Api.Extensions;
|
||||||
using Jellyfin.Api.ModelBinders;
|
using Jellyfin.Api.ModelBinders;
|
||||||
using Jellyfin.Api.Models.LibraryDtos;
|
using Jellyfin.Api.Models.LibraryDtos;
|
||||||
using Jellyfin.Data.Entities;
|
using Jellyfin.Data.Entities;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Common.Progress;
|
using MediaBrowser.Common.Progress;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Dto;
|
using MediaBrowser.Controller.Dto;
|
||||||
|
@ -413,14 +414,14 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var counts = new ItemCounts
|
var counts = new ItemCounts
|
||||||
{
|
{
|
||||||
AlbumCount = GetCount(typeof(MusicAlbum), user, isFavorite),
|
AlbumCount = GetCount(BaseItemKind.MusicAlbum, user, isFavorite),
|
||||||
EpisodeCount = GetCount(typeof(Episode), user, isFavorite),
|
EpisodeCount = GetCount(BaseItemKind.Episode, user, isFavorite),
|
||||||
MovieCount = GetCount(typeof(Movie), user, isFavorite),
|
MovieCount = GetCount(BaseItemKind.Movie, user, isFavorite),
|
||||||
SeriesCount = GetCount(typeof(Series), user, isFavorite),
|
SeriesCount = GetCount(BaseItemKind.Series, user, isFavorite),
|
||||||
SongCount = GetCount(typeof(Audio), user, isFavorite),
|
SongCount = GetCount(BaseItemKind.Audio, user, isFavorite),
|
||||||
MusicVideoCount = GetCount(typeof(MusicVideo), user, isFavorite),
|
MusicVideoCount = GetCount(BaseItemKind.MusicVideo, user, isFavorite),
|
||||||
BoxSetCount = GetCount(typeof(BoxSet), user, isFavorite),
|
BoxSetCount = GetCount(BaseItemKind.BoxSet, user, isFavorite),
|
||||||
BookCount = GetCount(typeof(Book), user, isFavorite)
|
BookCount = GetCount(BaseItemKind.Book, user, isFavorite)
|
||||||
};
|
};
|
||||||
|
|
||||||
return counts;
|
return counts;
|
||||||
|
@ -529,7 +530,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
var series = _libraryManager.GetItemList(new InternalItemsQuery
|
var series = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Series) },
|
IncludeItemTypes = new[] { BaseItemKind.Series },
|
||||||
DtoOptions = new DtoOptions(false)
|
DtoOptions = new DtoOptions(false)
|
||||||
{
|
{
|
||||||
EnableImages = false
|
EnableImages = false
|
||||||
|
@ -559,7 +560,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
var movies = _libraryManager.GetItemList(new InternalItemsQuery
|
var movies = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Movie) },
|
IncludeItemTypes = new[] { BaseItemKind.Movie },
|
||||||
DtoOptions = new DtoOptions(false)
|
DtoOptions = new DtoOptions(false)
|
||||||
{
|
{
|
||||||
EnableImages = false
|
EnableImages = false
|
||||||
|
@ -715,26 +716,26 @@ namespace Jellyfin.Api.Controllers
|
||||||
bool? isMovie = item is Movie || (program != null && program.IsMovie) || item is Trailer;
|
bool? isMovie = item is Movie || (program != null && program.IsMovie) || item is Trailer;
|
||||||
bool? isSeries = item is Series || (program != null && program.IsSeries);
|
bool? isSeries = item is Series || (program != null && program.IsSeries);
|
||||||
|
|
||||||
var includeItemTypes = new List<string>();
|
var includeItemTypes = new List<BaseItemKind>();
|
||||||
if (isMovie.Value)
|
if (isMovie.Value)
|
||||||
{
|
{
|
||||||
includeItemTypes.Add(nameof(Movie));
|
includeItemTypes.Add(BaseItemKind.Movie);
|
||||||
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
||||||
{
|
{
|
||||||
includeItemTypes.Add(nameof(Trailer));
|
includeItemTypes.Add(BaseItemKind.Trailer);
|
||||||
includeItemTypes.Add(nameof(LiveTvProgram));
|
includeItemTypes.Add(BaseItemKind.LiveTvProgram);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isSeries.Value)
|
else if (isSeries.Value)
|
||||||
{
|
{
|
||||||
includeItemTypes.Add(nameof(Series));
|
includeItemTypes.Add(BaseItemKind.Series);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// For non series and movie types these columns are typically null
|
// For non series and movie types these columns are typically null
|
||||||
isSeries = null;
|
isSeries = null;
|
||||||
isMovie = null;
|
isMovie = null;
|
||||||
includeItemTypes.Add(item.GetType().Name);
|
includeItemTypes.Add(item.GetBaseItemKind());
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
|
@ -871,11 +872,11 @@ namespace Jellyfin.Api.Controllers
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int GetCount(Type type, User? user, bool? isFavorite)
|
private int GetCount(BaseItemKind itemKind, User? user, bool? isFavorite)
|
||||||
{
|
{
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { type.Name },
|
IncludeItemTypes = new[] { itemKind },
|
||||||
Limit = 0,
|
Limit = 0,
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[]
|
IncludeItemTypes = new[]
|
||||||
{
|
{
|
||||||
nameof(Movie),
|
BaseItemKind.Movie,
|
||||||
// nameof(Trailer),
|
// nameof(Trailer),
|
||||||
// nameof(LiveTvProgram)
|
// nameof(LiveTvProgram)
|
||||||
},
|
},
|
||||||
|
@ -99,11 +99,11 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var recentlyPlayedMovies = _libraryManager.GetItemList(query);
|
var recentlyPlayedMovies = _libraryManager.GetItemList(query);
|
||||||
|
|
||||||
var itemTypes = new List<string> { nameof(Movie) };
|
var itemTypes = new List<BaseItemKind> { BaseItemKind.Movie };
|
||||||
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
||||||
{
|
{
|
||||||
itemTypes.Add(nameof(Trailer));
|
itemTypes.Add(BaseItemKind.Trailer);
|
||||||
itemTypes.Add(nameof(LiveTvProgram));
|
itemTypes.Add(BaseItemKind.LiveTvProgram);
|
||||||
}
|
}
|
||||||
|
|
||||||
var likedMovies = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
var likedMovies = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
|
@ -182,11 +182,11 @@ namespace Jellyfin.Api.Controllers
|
||||||
DtoOptions dtoOptions,
|
DtoOptions dtoOptions,
|
||||||
RecommendationType type)
|
RecommendationType type)
|
||||||
{
|
{
|
||||||
var itemTypes = new List<string> { nameof(Movie) };
|
var itemTypes = new List<BaseItemKind> { BaseItemKind.Movie };
|
||||||
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
||||||
{
|
{
|
||||||
itemTypes.Add(nameof(Trailer));
|
itemTypes.Add(BaseItemKind.Trailer);
|
||||||
itemTypes.Add(nameof(LiveTvProgram));
|
itemTypes.Add(BaseItemKind.LiveTvProgram);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var name in names)
|
foreach (var name in names)
|
||||||
|
@ -224,11 +224,11 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
private IEnumerable<RecommendationDto> GetWithActor(User? user, IEnumerable<string> names, int itemLimit, DtoOptions dtoOptions, RecommendationType type)
|
private IEnumerable<RecommendationDto> GetWithActor(User? user, IEnumerable<string> names, int itemLimit, DtoOptions dtoOptions, RecommendationType type)
|
||||||
{
|
{
|
||||||
var itemTypes = new List<string> { nameof(Movie) };
|
var itemTypes = new List<BaseItemKind> { BaseItemKind.Movie };
|
||||||
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
||||||
{
|
{
|
||||||
itemTypes.Add(nameof(Trailer));
|
itemTypes.Add(BaseItemKind.Trailer);
|
||||||
itemTypes.Add(nameof(LiveTvProgram));
|
itemTypes.Add(BaseItemKind.LiveTvProgram);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var name in names)
|
foreach (var name in names)
|
||||||
|
@ -264,11 +264,11 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
private IEnumerable<RecommendationDto> GetSimilarTo(User? user, IEnumerable<BaseItem> baselineItems, int itemLimit, DtoOptions dtoOptions, RecommendationType type)
|
private IEnumerable<RecommendationDto> GetSimilarTo(User? user, IEnumerable<BaseItem> baselineItems, int itemLimit, DtoOptions dtoOptions, RecommendationType type)
|
||||||
{
|
{
|
||||||
var itemTypes = new List<string> { nameof(Movie) };
|
var itemTypes = new List<BaseItemKind> { BaseItemKind.Movie };
|
||||||
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
if (_serverConfigurationManager.Configuration.EnableExternalContentInSuggestions)
|
||||||
{
|
{
|
||||||
itemTypes.Add(nameof(Trailer));
|
itemTypes.Add(BaseItemKind.Trailer);
|
||||||
itemTypes.Add(nameof(LiveTvProgram));
|
itemTypes.Add(BaseItemKind.LiveTvProgram);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in baselineItems)
|
foreach (var item in baselineItems)
|
||||||
|
|
|
@ -101,8 +101,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
IsFavorite = isFavorite,
|
IsFavorite = isFavorite,
|
||||||
|
@ -149,7 +149,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
if (genreName.IndexOf(BaseItem.SlugChar, StringComparison.OrdinalIgnoreCase) != -1)
|
if (genreName.IndexOf(BaseItem.SlugChar, StringComparison.OrdinalIgnoreCase) != -1)
|
||||||
{
|
{
|
||||||
item = GetItemFromSlugName<MusicGenre>(_libraryManager, genreName, dtoOptions);
|
item = GetItemFromSlugName<MusicGenre>(_libraryManager, genreName, dtoOptions, BaseItemKind.MusicGenre);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -166,27 +166,27 @@ namespace Jellyfin.Api.Controllers
|
||||||
return _dtoService.GetBaseItemDto(item, dtoOptions);
|
return _dtoService.GetBaseItemDto(item, dtoOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
private T? GetItemFromSlugName<T>(ILibraryManager libraryManager, string name, DtoOptions dtoOptions)
|
private T? GetItemFromSlugName<T>(ILibraryManager libraryManager, string name, DtoOptions dtoOptions, BaseItemKind baseItemKind)
|
||||||
where T : BaseItem, new()
|
where T : BaseItem, new()
|
||||||
{
|
{
|
||||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
Name = name.Replace(BaseItem.SlugChar, '&'),
|
Name = name.Replace(BaseItem.SlugChar, '&'),
|
||||||
IncludeItemTypes = new[] { typeof(T).Name },
|
IncludeItemTypes = new[] { baseItemKind },
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
}).OfType<T>().FirstOrDefault();
|
}).OfType<T>().FirstOrDefault();
|
||||||
|
|
||||||
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
Name = name.Replace(BaseItem.SlugChar, '/'),
|
Name = name.Replace(BaseItem.SlugChar, '/'),
|
||||||
IncludeItemTypes = new[] { typeof(T).Name },
|
IncludeItemTypes = new[] { baseItemKind },
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
}).OfType<T>().FirstOrDefault();
|
}).OfType<T>().FirstOrDefault();
|
||||||
|
|
||||||
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
result ??= libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
Name = name.Replace(BaseItem.SlugChar, '?'),
|
Name = name.Replace(BaseItem.SlugChar, '?'),
|
||||||
IncludeItemTypes = new[] { typeof(T).Name },
|
IncludeItemTypes = new[] { baseItemKind },
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
}).OfType<T>().FirstOrDefault();
|
}).OfType<T>().FirstOrDefault();
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
IncludeStudios = includeStudios,
|
IncludeStudios = includeStudios,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
UserId = userId ?? Guid.Empty,
|
UserId = userId ?? Guid.Empty,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
ParentId = parentId,
|
ParentId = parentId,
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<ActionResult> DisplayContent(
|
public async Task<ActionResult> DisplayContent(
|
||||||
[FromRoute, Required] string sessionId,
|
[FromRoute, Required] string sessionId,
|
||||||
[FromQuery, Required] string itemType,
|
[FromQuery, Required] BaseItemKind itemType,
|
||||||
[FromQuery, Required] string itemId,
|
[FromQuery, Required] string itemId,
|
||||||
[FromQuery, Required] string itemName)
|
[FromQuery, Required] string itemName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,8 +97,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
IsFavorite = isFavorite,
|
IsFavorite = isFavorite,
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetSuggestions(
|
public ActionResult<QueryResult<BaseItemDto>> GetSuggestions(
|
||||||
[FromRoute, Required] Guid userId,
|
[FromRoute, Required] Guid userId,
|
||||||
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] mediaType,
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] mediaType,
|
||||||
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] type,
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] BaseItemKind[] type,
|
||||||
[FromQuery] int? startIndex,
|
[FromQuery] int? startIndex,
|
||||||
[FromQuery] int? limit,
|
[FromQuery] int? limit,
|
||||||
[FromQuery] bool enableTotalRecordCount = false)
|
[FromQuery] bool enableTotalRecordCount = false)
|
||||||
|
|
|
@ -157,7 +157,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var itemsResult = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
var itemsResult = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Episode) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode },
|
||||||
OrderBy = new[] { (ItemSortBy.PremiereDate, SortOrder.Ascending), (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.PremiereDate, SortOrder.Ascending), (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
MinPremiereDate = minPremiereDate,
|
MinPremiereDate = minPremiereDate,
|
||||||
StartIndex = startIndex,
|
StartIndex = startIndex,
|
||||||
|
|
|
@ -297,7 +297,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
new LatestItemsQuery
|
new LatestItemsQuery
|
||||||
{
|
{
|
||||||
GroupItems = groupItems,
|
GroupItems = groupItems,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
IsPlayed = isPlayed,
|
IsPlayed = isPlayed,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
ParentId = parentId ?? Guid.Empty,
|
ParentId = parentId ?? Guid.Empty,
|
||||||
|
|
|
@ -101,8 +101,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var query = new InternalItemsQuery(user)
|
var query = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
ExcludeItemTypes = RequestHelpers.GetItemTypeStrings(excludeItemTypes),
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
IncludeItemTypes = RequestHelpers.GetItemTypeStrings(includeItemTypes),
|
IncludeItemTypes = includeItemTypes,
|
||||||
MediaTypes = mediaTypes,
|
MediaTypes = mediaTypes,
|
||||||
DtoOptions = dtoOptions
|
DtoOptions = dtoOptions
|
||||||
};
|
};
|
||||||
|
|
|
@ -137,21 +137,5 @@ namespace Jellyfin.Api.Helpers
|
||||||
TotalRecordCount = result.TotalRecordCount
|
TotalRecordCount = result.TotalRecordCount
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string[] GetItemTypeStrings(IReadOnlyList<BaseItemKind> itemKinds)
|
|
||||||
{
|
|
||||||
if (itemKinds.Count == 0)
|
|
||||||
{
|
|
||||||
return Array.Empty<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
var itemTypes = new string[itemKinds.Count];
|
|
||||||
for (var i = 0; i < itemKinds.Count; i++)
|
|
||||||
{
|
|
||||||
itemTypes[i] = itemKinds[i].ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return itemTypes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
{
|
{
|
||||||
if (query.IncludeItemTypes.Length == 0)
|
if (query.IncludeItemTypes.Length == 0)
|
||||||
{
|
{
|
||||||
query.IncludeItemTypes = new[] { nameof(Audio), nameof(MusicVideo), nameof(MusicAlbum) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Audio, BaseItemKind.MusicVideo, BaseItemKind.MusicAlbum };
|
||||||
query.ArtistIds = new[] { Id };
|
query.ArtistIds = new[] { Id };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Diacritics.Extensions;
|
using Diacritics.Extensions;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities.Audio
|
namespace MediaBrowser.Controller.Entities.Audio
|
||||||
|
@ -66,7 +67,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
public IList<BaseItem> GetTaggedItems(InternalItemsQuery query)
|
public IList<BaseItem> GetTaggedItems(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
query.GenreIds = new[] { Id };
|
query.GenreIds = new[] { Id };
|
||||||
query.IncludeItemTypes = new[] { nameof(MusicVideo), nameof(Audio), nameof(MusicAlbum), nameof(MusicArtist) };
|
query.IncludeItemTypes = new[] { BaseItemKind.MusicVideo, BaseItemKind.Audio, BaseItemKind.MusicAlbum, BaseItemKind.MusicArtist };
|
||||||
|
|
||||||
return LibraryManager.GetItemList(query);
|
return LibraryManager.GetItemList(query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseItem : IHasProviderIds, IHasLookupInfo<ItemLookupInfo>, IEquatable<BaseItem>
|
public abstract class BaseItem : IHasProviderIds, IHasLookupInfo<ItemLookupInfo>, IEquatable<BaseItem>
|
||||||
{
|
{
|
||||||
|
private BaseItemKind? _baseItemKind;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The trailer folder name.
|
/// The trailer folder name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2009,7 +2011,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public BaseItemKind GetBaseItemKind()
|
public BaseItemKind GetBaseItemKind()
|
||||||
{
|
{
|
||||||
return Enum.Parse<BaseItemKind>(GetClientTypeName());
|
return _baseItemKind ??= Enum.Parse<BaseItemKind>(GetClientTypeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -792,7 +792,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
private bool RequiresPostFiltering2(InternalItemsQuery query)
|
private bool RequiresPostFiltering2(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (query.IncludeItemTypes.Length == 1 && string.Equals(query.IncludeItemTypes[0], nameof(BoxSet), StringComparison.OrdinalIgnoreCase))
|
if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes[0] == BaseItemKind.BoxSet)
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Query requires post-filtering due to BoxSet query");
|
Logger.LogDebug("Query requires post-filtering due to BoxSet query");
|
||||||
return true;
|
return true;
|
||||||
|
@ -882,7 +882,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
if (query.IsPlayed.HasValue)
|
if (query.IsPlayed.HasValue)
|
||||||
{
|
{
|
||||||
if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes.Contains(nameof(Series)))
|
if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes.Contains(BaseItemKind.Series))
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Query requires post-filtering due to IsPlayed");
|
Logger.LogDebug("Query requires post-filtering due to IsPlayed");
|
||||||
return true;
|
return true;
|
||||||
|
@ -1101,7 +1101,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.IncludeItemTypes.Length == 0 || query.IncludeItemTypes.Contains("Movie", StringComparer.OrdinalIgnoreCase))
|
if (query.IncludeItemTypes.Length == 0 || query.IncludeItemTypes.Contains(BaseItemKind.Movie))
|
||||||
{
|
{
|
||||||
param = true;
|
param = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Diacritics.Extensions;
|
using Diacritics.Extensions;
|
||||||
using MediaBrowser.Controller.Entities.Audio;
|
using Jellyfin.Data.Enums;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
|
@ -66,10 +66,10 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.GenreIds = new[] { Id };
|
query.GenreIds = new[] { Id };
|
||||||
query.ExcludeItemTypes = new[]
|
query.ExcludeItemTypes = new[]
|
||||||
{
|
{
|
||||||
nameof(MusicVideo),
|
BaseItemKind.MusicVideo,
|
||||||
nameof(Entities.Audio.Audio),
|
BaseItemKind.Audio,
|
||||||
nameof(MusicAlbum),
|
BaseItemKind.MusicAlbum,
|
||||||
nameof(MusicArtist)
|
BaseItemKind.MusicArtist
|
||||||
};
|
};
|
||||||
|
|
||||||
return LibraryManager.GetItemList(query);
|
return LibraryManager.GetItemList(query);
|
||||||
|
|
|
@ -27,13 +27,13 @@ namespace MediaBrowser.Controller.Entities
|
||||||
ExcludeArtistIds = Array.Empty<Guid>();
|
ExcludeArtistIds = Array.Empty<Guid>();
|
||||||
ExcludeInheritedTags = Array.Empty<string>();
|
ExcludeInheritedTags = Array.Empty<string>();
|
||||||
ExcludeItemIds = Array.Empty<Guid>();
|
ExcludeItemIds = Array.Empty<Guid>();
|
||||||
ExcludeItemTypes = Array.Empty<string>();
|
ExcludeItemTypes = Array.Empty<BaseItemKind>();
|
||||||
ExcludeTags = Array.Empty<string>();
|
ExcludeTags = Array.Empty<string>();
|
||||||
GenreIds = Array.Empty<Guid>();
|
GenreIds = Array.Empty<Guid>();
|
||||||
Genres = Array.Empty<string>();
|
Genres = Array.Empty<string>();
|
||||||
GroupByPresentationUniqueKey = true;
|
GroupByPresentationUniqueKey = true;
|
||||||
ImageTypes = Array.Empty<ImageType>();
|
ImageTypes = Array.Empty<ImageType>();
|
||||||
IncludeItemTypes = Array.Empty<string>();
|
IncludeItemTypes = Array.Empty<BaseItemKind>();
|
||||||
ItemIds = Array.Empty<Guid>();
|
ItemIds = Array.Empty<Guid>();
|
||||||
MediaTypes = Array.Empty<string>();
|
MediaTypes = Array.Empty<string>();
|
||||||
MinSimilarityScore = 20;
|
MinSimilarityScore = 20;
|
||||||
|
@ -87,9 +87,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public string[] MediaTypes { get; set; }
|
public string[] MediaTypes { get; set; }
|
||||||
|
|
||||||
public string[] IncludeItemTypes { get; set; }
|
public BaseItemKind[] IncludeItemTypes { get; set; }
|
||||||
|
|
||||||
public string[] ExcludeItemTypes { get; set; }
|
public BaseItemKind[] ExcludeItemTypes { get; set; }
|
||||||
|
|
||||||
public string[] ExcludeTags { get; set; }
|
public string[] ExcludeTags { get; set; }
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public Guid ParentId { get; set; }
|
public Guid ParentId { get; set; }
|
||||||
|
|
||||||
public string? ParentType { get; set; }
|
public BaseItemKind? ParentType { get; set; }
|
||||||
|
|
||||||
public Guid[] AncestorIds { get; set; }
|
public Guid[] AncestorIds { get; set; }
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ParentId = value.Id;
|
ParentId = value.Id;
|
||||||
ParentType = value.GetType().Name;
|
ParentType = value.GetBaseItemKind();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
{
|
{
|
||||||
AncestorWithPresentationUniqueKey = null,
|
AncestorWithPresentationUniqueKey = null,
|
||||||
SeriesPresentationUniqueKey = seriesKey,
|
SeriesPresentationUniqueKey = seriesKey,
|
||||||
IncludeItemTypes = new[] { nameof(Season) },
|
IncludeItemTypes = new[] { BaseItemKind.Season },
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
Limit = 0,
|
Limit = 0,
|
||||||
DtoOptions = new DtoOptions(false)
|
DtoOptions = new DtoOptions(false)
|
||||||
|
@ -159,7 +159,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
if (query.IncludeItemTypes.Length == 0)
|
if (query.IncludeItemTypes.Length == 0)
|
||||||
{
|
{
|
||||||
query.IncludeItemTypes = new[] { nameof(Episode) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Episode };
|
||||||
}
|
}
|
||||||
|
|
||||||
query.IsVirtualItem = false;
|
query.IsVirtualItem = false;
|
||||||
|
@ -213,7 +213,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
query.AncestorWithPresentationUniqueKey = null;
|
query.AncestorWithPresentationUniqueKey = null;
|
||||||
query.SeriesPresentationUniqueKey = seriesKey;
|
query.SeriesPresentationUniqueKey = seriesKey;
|
||||||
query.IncludeItemTypes = new[] { nameof(Season) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Season };
|
||||||
query.OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) };
|
query.OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) };
|
||||||
|
|
||||||
if (user != null && !user.DisplayMissingEpisodes)
|
if (user != null && !user.DisplayMissingEpisodes)
|
||||||
|
@ -239,7 +239,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
if (query.IncludeItemTypes.Length == 0)
|
if (query.IncludeItemTypes.Length == 0)
|
||||||
{
|
{
|
||||||
query.IncludeItemTypes = new[] { nameof(Episode), nameof(Season) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Episode, BaseItemKind.Season };
|
||||||
}
|
}
|
||||||
|
|
||||||
query.IsVirtualItem = false;
|
query.IsVirtualItem = false;
|
||||||
|
@ -259,7 +259,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
{
|
{
|
||||||
AncestorWithPresentationUniqueKey = null,
|
AncestorWithPresentationUniqueKey = null,
|
||||||
SeriesPresentationUniqueKey = seriesKey,
|
SeriesPresentationUniqueKey = seriesKey,
|
||||||
IncludeItemTypes = new[] { nameof(Episode), nameof(Season) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode, BaseItemKind.Season },
|
||||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
DtoOptions = options
|
DtoOptions = options
|
||||||
};
|
};
|
||||||
|
@ -363,7 +363,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
{
|
{
|
||||||
AncestorWithPresentationUniqueKey = queryFromSeries ? null : seriesKey,
|
AncestorWithPresentationUniqueKey = queryFromSeries ? null : seriesKey,
|
||||||
SeriesPresentationUniqueKey = queryFromSeries ? seriesKey : null,
|
SeriesPresentationUniqueKey = queryFromSeries ? seriesKey : null,
|
||||||
IncludeItemTypes = new[] { nameof(Episode) },
|
IncludeItemTypes = new[] { BaseItemKind.Episode },
|
||||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
DtoOptions = options
|
DtoOptions = options
|
||||||
};
|
};
|
||||||
|
|
|
@ -140,7 +140,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
if (query.IncludeItemTypes.Length == 0)
|
if (query.IncludeItemTypes.Length == 0)
|
||||||
{
|
{
|
||||||
query.IncludeItemTypes = new[] { nameof(Movie) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent.QueryRecursive(query);
|
return parent.QueryRecursive(query);
|
||||||
|
@ -165,7 +165,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.IsFavorite = true;
|
query.IsFavorite = true;
|
||||||
query.IncludeItemTypes = new[] { nameof(Movie) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
|
|
||||||
return _libraryManager.GetItemsResult(query);
|
return _libraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.IsFavorite = true;
|
query.IsFavorite = true;
|
||||||
query.IncludeItemTypes = new[] { nameof(Series) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Series };
|
||||||
|
|
||||||
return _libraryManager.GetItemsResult(query);
|
return _libraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.IsFavorite = true;
|
query.IsFavorite = true;
|
||||||
query.IncludeItemTypes = new[] { nameof(Episode) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Episode };
|
||||||
|
|
||||||
return _libraryManager.GetItemsResult(query);
|
return _libraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
|
|
||||||
query.IncludeItemTypes = new[] { nameof(Movie) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
|
|
||||||
return _libraryManager.GetItemsResult(query);
|
return _libraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
private QueryResult<BaseItem> GetMovieCollections(User user, InternalItemsQuery query)
|
private QueryResult<BaseItem> GetMovieCollections(User user, InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
query.Parent = null;
|
query.Parent = null;
|
||||||
query.IncludeItemTypes = new[] { nameof(BoxSet) };
|
query.IncludeItemTypes = new[] { BaseItemKind.BoxSet };
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.Recursive = true;
|
query.Recursive = true;
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.Limit = GetSpecialItemsLimit();
|
query.Limit = GetSpecialItemsLimit();
|
||||||
query.IncludeItemTypes = new[] { nameof(Movie) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
|
|
||||||
return ConvertToResult(_libraryManager.GetItemList(query));
|
return ConvertToResult(_libraryManager.GetItemList(query));
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.Limit = GetSpecialItemsLimit();
|
query.Limit = GetSpecialItemsLimit();
|
||||||
query.IncludeItemTypes = new[] { nameof(Movie) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
|
|
||||||
return ConvertToResult(_libraryManager.GetItemList(query));
|
return ConvertToResult(_libraryManager.GetItemList(query));
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
var genres = parent.QueryRecursive(new InternalItemsQuery(user)
|
var genres = parent.QueryRecursive(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Movie) },
|
IncludeItemTypes = new[] { BaseItemKind.Movie },
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
EnableTotalRecordCount = false
|
EnableTotalRecordCount = false
|
||||||
}).Items
|
}).Items
|
||||||
|
@ -283,7 +283,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.GenreIds = new[] { displayParent.Id };
|
query.GenreIds = new[] { displayParent.Id };
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
|
|
||||||
query.IncludeItemTypes = new[] { nameof(Movie) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Movie };
|
||||||
|
|
||||||
return _libraryManager.GetItemsResult(query);
|
return _libraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
@ -299,9 +299,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
query.IncludeItemTypes = new[]
|
query.IncludeItemTypes = new[]
|
||||||
{
|
{
|
||||||
nameof(Series),
|
BaseItemKind.Series,
|
||||||
nameof(Season),
|
BaseItemKind.Season,
|
||||||
nameof(Episode)
|
BaseItemKind.Episode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.Limit = GetSpecialItemsLimit();
|
query.Limit = GetSpecialItemsLimit();
|
||||||
query.IncludeItemTypes = new[] { nameof(Episode) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Episode };
|
||||||
query.IsVirtualItem = false;
|
query.IsVirtualItem = false;
|
||||||
|
|
||||||
return ConvertToResult(_libraryManager.GetItemList(query));
|
return ConvertToResult(_libraryManager.GetItemList(query));
|
||||||
|
@ -360,7 +360,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.Limit = GetSpecialItemsLimit();
|
query.Limit = GetSpecialItemsLimit();
|
||||||
query.IncludeItemTypes = new[] { nameof(Episode) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Episode };
|
||||||
|
|
||||||
return ConvertToResult(_libraryManager.GetItemList(query));
|
return ConvertToResult(_libraryManager.GetItemList(query));
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.Parent = parent;
|
query.Parent = parent;
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
|
|
||||||
query.IncludeItemTypes = new[] { nameof(Series) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Series };
|
||||||
|
|
||||||
return _libraryManager.GetItemsResult(query);
|
return _libraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
var genres = parent.QueryRecursive(new InternalItemsQuery(user)
|
var genres = parent.QueryRecursive(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(Series) },
|
IncludeItemTypes = new[] { BaseItemKind.Series },
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
EnableTotalRecordCount = false
|
EnableTotalRecordCount = false
|
||||||
}).Items
|
}).Items
|
||||||
|
@ -411,7 +411,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
query.GenreIds = new[] { displayParent.Id };
|
query.GenreIds = new[] { displayParent.Id };
|
||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
|
|
||||||
query.IncludeItemTypes = new[] { nameof(Series) };
|
query.IncludeItemTypes = new[] { BaseItemKind.Series };
|
||||||
|
|
||||||
return _libraryManager.GetItemsResult(query);
|
return _libraryManager.GetItemsResult(query);
|
||||||
}
|
}
|
||||||
|
@ -499,12 +499,12 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.IncludeItemTypes.Length > 0 && !query.IncludeItemTypes.Contains(item.GetClientTypeName(), StringComparer.OrdinalIgnoreCase))
|
if (query.IncludeItemTypes.Length > 0 && !query.IncludeItemTypes.Contains(item.GetBaseItemKind()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.ExcludeItemTypes.Length > 0 && query.ExcludeItemTypes.Contains(item.GetClientTypeName(), StringComparer.OrdinalIgnoreCase))
|
if (query.ExcludeItemTypes.Length > 0 && query.ExcludeItemTypes.Contains(item.GetBaseItemKind()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||||
return LibraryManager.GetItemList(new InternalItemsQuery(user)
|
return LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
IncludeItemTypes = new[] { nameof(Audio) },
|
IncludeItemTypes = new[] { BaseItemKind.Audio },
|
||||||
GenreIds = new[] { musicGenre.Id },
|
GenreIds = new[] { musicGenre.Id },
|
||||||
OrderBy = new[] { (ItemSortBy.AlbumArtist, SortOrder.Ascending), (ItemSortBy.Album, SortOrder.Ascending), (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.AlbumArtist, SortOrder.Ascending), (ItemSortBy.Album, SortOrder.Ascending), (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
DtoOptions = options
|
DtoOptions = options
|
||||||
|
@ -201,7 +201,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||||
return LibraryManager.GetItemList(new InternalItemsQuery(user)
|
return LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
IncludeItemTypes = new[] { nameof(Audio) },
|
IncludeItemTypes = new[] { BaseItemKind.Audio },
|
||||||
ArtistIds = new[] { musicArtist.Id },
|
ArtistIds = new[] { musicArtist.Id },
|
||||||
OrderBy = new[] { (ItemSortBy.AlbumArtist, SortOrder.Ascending), (ItemSortBy.Album, SortOrder.Ascending), (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.AlbumArtist, SortOrder.Ascending), (ItemSortBy.Album, SortOrder.Ascending), (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
DtoOptions = options
|
DtoOptions = options
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Querying
|
namespace MediaBrowser.Model.Querying
|
||||||
|
@ -48,7 +49,7 @@ namespace MediaBrowser.Model.Querying
|
||||||
/// Gets or sets the include item types.
|
/// Gets or sets the include item types.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The include item types.</value>
|
/// <value>The include item types.</value>
|
||||||
public string[] IncludeItemTypes { get; set; }
|
public BaseItemKind[] IncludeItemTypes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance is played.
|
/// Gets or sets a value indicating whether this instance is played.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Search
|
namespace MediaBrowser.Model.Search
|
||||||
{
|
{
|
||||||
|
@ -16,8 +17,8 @@ namespace MediaBrowser.Model.Search
|
||||||
IncludeStudios = true;
|
IncludeStudios = true;
|
||||||
|
|
||||||
MediaTypes = Array.Empty<string>();
|
MediaTypes = Array.Empty<string>();
|
||||||
IncludeItemTypes = Array.Empty<string>();
|
IncludeItemTypes = Array.Empty<BaseItemKind>();
|
||||||
ExcludeItemTypes = Array.Empty<string>();
|
ExcludeItemTypes = Array.Empty<BaseItemKind>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -56,9 +57,9 @@ namespace MediaBrowser.Model.Search
|
||||||
|
|
||||||
public string[] MediaTypes { get; set; }
|
public string[] MediaTypes { get; set; }
|
||||||
|
|
||||||
public string[] IncludeItemTypes { get; set; }
|
public BaseItemKind[] IncludeItemTypes { get; set; }
|
||||||
|
|
||||||
public string[] ExcludeItemTypes { get; set; }
|
public BaseItemKind[] ExcludeItemTypes { get; set; }
|
||||||
|
|
||||||
public Guid? ParentId { get; set; }
|
public Guid? ParentId { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
namespace MediaBrowser.Model.Session
|
namespace MediaBrowser.Model.Session
|
||||||
{
|
{
|
||||||
|
@ -8,10 +10,9 @@ namespace MediaBrowser.Model.Session
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the item type.
|
/// Gets or sets the item type.
|
||||||
/// Artist, Genre, Studio, Person, or any kind of BaseItem.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The type of the item.</value>
|
/// <value>The type of the item.</value>
|
||||||
public string ItemType { get; set; }
|
public BaseItemKind ItemType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the item id.
|
/// Gets or sets the item id.
|
||||||
|
|
|
@ -11,6 +11,7 @@ using System.Net.Http;
|
||||||
using System.Net.Mime;
|
using System.Net.Mime;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using Jellyfin.Data.Events;
|
using Jellyfin.Data.Events;
|
||||||
using MediaBrowser.Common.Net;
|
using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Common.Progress;
|
using MediaBrowser.Common.Progress;
|
||||||
|
@ -1133,7 +1134,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
var albums = _libraryManager
|
var albums = _libraryManager
|
||||||
.GetItemList(new InternalItemsQuery
|
.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { nameof(MusicAlbum) },
|
IncludeItemTypes = new[] { BaseItemKind.MusicAlbum },
|
||||||
ArtistIds = new[] { item.Id },
|
ArtistIds = new[] { item.Id },
|
||||||
DtoOptions = new DtoOptions(false)
|
DtoOptions = new DtoOptions(false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Data.Enums;
|
||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Dto;
|
using MediaBrowser.Controller.Dto;
|
||||||
|
@ -66,7 +67,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
{
|
{
|
||||||
var options = GetOptions();
|
var options = GetOptions();
|
||||||
|
|
||||||
var types = new[] { "Episode", "Movie" };
|
var types = new[] { BaseItemKind.Episode, BaseItemKind.Movie };
|
||||||
|
|
||||||
var dict = new Dictionary<Guid, BaseItem>();
|
var dict = new Dictionary<Guid, BaseItem>();
|
||||||
|
|
||||||
|
|
|
@ -55,35 +55,5 @@ namespace Jellyfin.Api.Tests.Helpers
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public static void GetItemTypeStrings_Empty_Empty()
|
|
||||||
{
|
|
||||||
Assert.Empty(RequestHelpers.GetItemTypeStrings(Array.Empty<BaseItemKind>()));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public static void GetItemTypeStrings_Valid_Success()
|
|
||||||
{
|
|
||||||
BaseItemKind[] input =
|
|
||||||
{
|
|
||||||
BaseItemKind.AggregateFolder,
|
|
||||||
BaseItemKind.Audio,
|
|
||||||
BaseItemKind.BasePluginFolder,
|
|
||||||
BaseItemKind.CollectionFolder
|
|
||||||
};
|
|
||||||
|
|
||||||
string[] expected =
|
|
||||||
{
|
|
||||||
"AggregateFolder",
|
|
||||||
"Audio",
|
|
||||||
"BasePluginFolder",
|
|
||||||
"CollectionFolder"
|
|
||||||
};
|
|
||||||
|
|
||||||
var res = RequestHelpers.GetItemTypeStrings(input);
|
|
||||||
|
|
||||||
Assert.Equal(expected, res);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user