Convert CollectionType to use lowercase enum names

This commit is contained in:
Cody Robibero 2023-12-08 15:45:36 -07:00
parent 0d5bbfda32
commit 033cfa59c4
26 changed files with 148 additions and 147 deletions

View File

@ -32,26 +32,26 @@ namespace Emby.Server.Implementations.Images
switch (viewType)
{
case CollectionType.Movies:
case CollectionType.movies:
includeItemTypes = new[] { BaseItemKind.Movie };
break;
case CollectionType.TvShows:
case CollectionType.tvshows:
includeItemTypes = new[] { BaseItemKind.Series };
break;
case CollectionType.Music:
case CollectionType.music:
includeItemTypes = new[] { BaseItemKind.MusicAlbum };
break;
case CollectionType.MusicVideos:
case CollectionType.musicvideos:
includeItemTypes = new[] { BaseItemKind.MusicVideo };
break;
case CollectionType.Books:
case CollectionType.books:
includeItemTypes = new[] { BaseItemKind.Book, BaseItemKind.AudioBook };
break;
case CollectionType.BoxSets:
case CollectionType.boxsets:
includeItemTypes = new[] { BaseItemKind.BoxSet };
break;
case CollectionType.HomeVideos:
case CollectionType.Photos:
case CollectionType.homevideos:
case CollectionType.photos:
includeItemTypes = new[] { BaseItemKind.Video, BaseItemKind.Photo };
break;
default:
@ -59,7 +59,7 @@ namespace Emby.Server.Implementations.Images
break;
}
var recursive = viewType != CollectionType.Playlists;
var recursive = viewType != CollectionType.playlists;
return view.GetItemList(new InternalItemsQuery
{

View File

@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.Images
var view = (UserView)item;
var isUsingCollectionStrip = IsUsingCollectionStrip(view);
var recursive = isUsingCollectionStrip && view?.ViewType is not null && view.ViewType != CollectionType.BoxSets && view.ViewType != CollectionType.Playlists;
var recursive = isUsingCollectionStrip && view?.ViewType is not null && view.ViewType != CollectionType.boxsets && view.ViewType != CollectionType.playlists;
var result = view.GetItemList(new InternalItemsQuery
{
@ -114,9 +114,9 @@ namespace Emby.Server.Implementations.Images
{
CollectionType[] collectionStripViewTypes =
{
CollectionType.Movies,
CollectionType.TvShows,
CollectionType.Playlists
CollectionType.movies,
CollectionType.tvshows,
CollectionType.playlists
};
return view?.ViewType is not null && collectionStripViewTypes.Contains(view.ViewType.Value);

View File

@ -1514,7 +1514,7 @@ namespace Emby.Server.Implementations.Library
{
if (item is UserView view)
{
if (view.ViewType == CollectionType.LiveTv)
if (view.ViewType == CollectionType.livetv)
{
return new[] { view.Id };
}
@ -1543,7 +1543,7 @@ namespace Emby.Server.Implementations.Library
}
// Handle grouping
if (user is not null && view.ViewType != CollectionType.Unknown && UserView.IsEligibleForGrouping(view.ViewType)
if (user is not null && view.ViewType != CollectionType.unknown && UserView.IsEligibleForGrouping(view.ViewType)
&& user.GetPreference(PreferenceKind.GroupedFolders).Length > 0)
{
return GetUserRootFolder()

View File

@ -61,7 +61,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
List<FileSystemMetadata> files,
CollectionType? collectionType)
{
if (collectionType == CollectionType.Books)
if (collectionType == CollectionType.books)
{
return ResolveMultipleAudio(parent, files, true);
}
@ -80,7 +80,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
var collectionType = args.GetCollectionType();
var isBooksCollectionType = collectionType == CollectionType.Books;
var isBooksCollectionType = collectionType == CollectionType.books;
if (args.IsDirectory)
{
@ -112,7 +112,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
MediaBrowser.Controller.Entities.Audio.Audio item = null;
var isMusicCollectionType = collectionType == CollectionType.Music;
var isMusicCollectionType = collectionType == CollectionType.music;
// Use regular audio type for mixed libraries, owned items and music
if (isMixedCollectionType ||

View File

@ -55,7 +55,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
protected override MusicAlbum Resolve(ItemResolveArgs args)
{
var collectionType = args.GetCollectionType();
var isMusicMediaFolder = collectionType == CollectionType.Music;
var isMusicMediaFolder = collectionType == CollectionType.music;
// If there's a collection type and it's not music, don't allow it.
if (!isMusicMediaFolder)

View File

@ -65,7 +65,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
var collectionType = args.GetCollectionType();
var isMusicMediaFolder = collectionType == CollectionType.Music;
var isMusicMediaFolder = collectionType == CollectionType.music;
// If there's a collection type and it's not music, it can't be a music artist
if (!isMusicMediaFolder)

View File

@ -23,7 +23,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Books
var collectionType = args.GetCollectionType();
// Only process items that are in a collection folder containing books
if (collectionType != CollectionType.Books)
if (collectionType != CollectionType.books)
{
return null;
}

View File

@ -31,11 +31,11 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
private static readonly CollectionType[] _validCollectionTypes = new[]
{
CollectionType.Movies,
CollectionType.HomeVideos,
CollectionType.MusicVideos,
CollectionType.TvShows,
CollectionType.Photos
CollectionType.movies,
CollectionType.homevideos,
CollectionType.musicvideos,
CollectionType.tvshows,
CollectionType.photos
};
/// <summary>
@ -100,12 +100,12 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
Video movie = null;
var files = args.GetActualFileSystemChildren().ToList();
if (collectionType == CollectionType.MusicVideos)
if (collectionType == CollectionType.musicvideos)
{
movie = FindMovie<MusicVideo>(args, args.Path, args.Parent, files, DirectoryService, collectionType, false);
}
if (collectionType == CollectionType.HomeVideos)
if (collectionType == CollectionType.homevideos)
{
movie = FindMovie<Video>(args, args.Path, args.Parent, files, DirectoryService, collectionType, false);
}
@ -126,7 +126,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
movie = FindMovie<Movie>(args, args.Path, args.Parent, files, DirectoryService, collectionType, true);
}
if (collectionType == CollectionType.Movies)
if (collectionType == CollectionType.movies)
{
movie = FindMovie<Movie>(args, args.Path, args.Parent, files, DirectoryService, collectionType, true);
}
@ -147,17 +147,17 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
Video item = null;
if (collectionType == CollectionType.MusicVideos)
if (collectionType == CollectionType.musicvideos)
{
item = ResolveVideo<MusicVideo>(args, false);
}
// To find a movie file, the collection type must be movies or boxsets
else if (collectionType == CollectionType.Movies)
else if (collectionType == CollectionType.movies)
{
item = ResolveVideo<Movie>(args, true);
}
else if (collectionType == CollectionType.HomeVideos || collectionType == CollectionType.Photos)
else if (collectionType == CollectionType.homevideos || collectionType == CollectionType.photos)
{
item = ResolveVideo<Video>(args, false);
}
@ -195,12 +195,12 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
return null;
}
if (collectionType is CollectionType.MusicVideos)
if (collectionType is CollectionType.musicvideos)
{
return ResolveVideos<MusicVideo>(parent, files, true, collectionType, false);
}
if (collectionType == CollectionType.HomeVideos || collectionType == CollectionType.Photos)
if (collectionType == CollectionType.homevideos || collectionType == CollectionType.photos)
{
return ResolveVideos<Video>(parent, files, false, collectionType, false);
}
@ -221,12 +221,12 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
return ResolveVideos<Movie>(parent, files, false, collectionType, true);
}
if (collectionType == CollectionType.Movies)
if (collectionType == CollectionType.movies)
{
return ResolveVideos<Movie>(parent, files, true, collectionType, true);
}
if (collectionType == CollectionType.TvShows)
if (collectionType == CollectionType.tvshows)
{
return ResolveVideos<Episode>(parent, files, false, collectionType, true);
}
@ -403,7 +403,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
var multiDiscFolders = new List<FileSystemMetadata>();
var libraryOptions = args.LibraryOptions;
var supportPhotos = collectionType == CollectionType.HomeVideos && libraryOptions.EnablePhotos;
var supportPhotos = collectionType == CollectionType.homevideos && libraryOptions.EnablePhotos;
var photos = new List<FileSystemMetadata>();
// Search for a folder rip
@ -459,7 +459,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
var result = ResolveVideos<T>(parent, fileSystemEntries, SupportsMultiVersion, collectionType, parseName) ??
new MultiItemResolverResult();
var isPhotosCollection = collectionType == CollectionType.HomeVideos || collectionType == CollectionType.Photos;
var isPhotosCollection = collectionType == CollectionType.homevideos || collectionType == CollectionType.photos;
if (!isPhotosCollection && result.Items.Count == 1)
{
var videoPath = result.Items[0].Path;

View File

@ -46,8 +46,8 @@ namespace Emby.Server.Implementations.Library.Resolvers
// Must be an image file within a photo collection
var collectionType = args.GetCollectionType();
if (collectionType == CollectionType.Photos
|| (collectionType == CollectionType.HomeVideos && args.LibraryOptions.EnablePhotos))
if (collectionType == CollectionType.photos
|| (collectionType == CollectionType.homevideos && args.LibraryOptions.EnablePhotos))
{
if (HasPhotos(args))
{

View File

@ -61,8 +61,8 @@ namespace Emby.Server.Implementations.Library.Resolvers
// Must be an image file within a photo collection
var collectionType = args.CollectionType;
if (collectionType == CollectionType.Photos
|| (collectionType == CollectionType.HomeVideos && args.LibraryOptions.EnablePhotos))
if (collectionType == CollectionType.photos
|| (collectionType == CollectionType.homevideos && args.LibraryOptions.EnablePhotos))
{
if (IsImageFile(args.Path, _imageProcessor))
{

View File

@ -23,7 +23,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
private CollectionType?[] _musicPlaylistCollectionTypes =
{
null,
CollectionType.Music
CollectionType.music
};
/// <inheritdoc/>

View File

@ -50,7 +50,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
// If the parent is a Season or Series and the parent is not an extras folder, then this is an Episode if the VideoResolver returns something
// Also handle flat tv folders
if (season is not null
|| args.GetCollectionType() == CollectionType.TvShows
|| args.GetCollectionType() == CollectionType.tvshows
|| args.HasParent<Series>())
{
var episode = ResolveVideo<Episode>(args, false);

View File

@ -60,11 +60,11 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
var seriesInfo = Naming.TV.SeriesResolver.Resolve(_namingOptions, args.Path);
var collectionType = args.GetCollectionType();
if (collectionType == CollectionType.TvShows)
if (collectionType == CollectionType.tvshows)
{
// TODO refactor into separate class or something, this is copied from LibraryManager.GetConfiguredContentType
var configuredContentType = args.GetConfiguredContentType();
if (configuredContentType != CollectionType.TvShows)
if (configuredContentType != CollectionType.tvshows)
{
return new Series
{

View File

@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Library
var folderViewType = collectionFolder?.CollectionType;
// Playlist library requires special handling because the folder only references user playlists
if (folderViewType == CollectionType.Playlists)
if (folderViewType == CollectionType.playlists)
{
var items = folder.GetItemList(new InternalItemsQuery(user)
{
@ -99,14 +99,14 @@ namespace Emby.Server.Implementations.Library
}
}
foreach (var viewType in new[] { CollectionType.Movies, CollectionType.TvShows })
foreach (var viewType in new[] { CollectionType.movies, CollectionType.tvshows })
{
var parents = groupedFolders.Where(i => i.CollectionType == viewType || i.CollectionType is null)
.ToList();
if (parents.Count > 0)
{
var localizationKey = viewType == CollectionType.TvShows
var localizationKey = viewType == CollectionType.tvshows
? "TvShows"
: "Movies";
@ -117,7 +117,7 @@ namespace Emby.Server.Implementations.Library
if (_config.Configuration.EnableFolderView)
{
var name = _localizationManager.GetLocalizedString("Folders");
list.Add(_libraryManager.GetNamedView(name, CollectionType.Folders, string.Empty));
list.Add(_libraryManager.GetNamedView(name, CollectionType.folders, string.Empty));
}
if (query.IncludeExternalContent)
@ -279,7 +279,7 @@ namespace Emby.Server.Implementations.Library
var isPlayed = request.IsPlayed;
if (parents.OfType<ICollectionFolder>().Any(i => i.CollectionType == CollectionType.Music))
if (parents.OfType<ICollectionFolder>().Any(i => i.CollectionType == CollectionType.music))
{
isPlayed = null;
}
@ -305,11 +305,11 @@ namespace Emby.Server.Implementations.Library
var hasCollectionType = parents.OfType<UserView>().ToArray();
if (hasCollectionType.Length > 0)
{
if (hasCollectionType.All(i => i.CollectionType == CollectionType.Movies))
if (hasCollectionType.All(i => i.CollectionType == CollectionType.movies))
{
includeItemTypes = new[] { BaseItemKind.Movie };
}
else if (hasCollectionType.All(i => i.CollectionType == CollectionType.TvShows))
else if (hasCollectionType.All(i => i.CollectionType == CollectionType.tvshows))
{
includeItemTypes = new[] { BaseItemKind.Episode };
}
@ -324,18 +324,18 @@ namespace Emby.Server.Implementations.Library
{
switch (parent.CollectionType)
{
case CollectionType.Books:
case CollectionType.books:
mediaTypes.Add(MediaType.Book);
mediaTypes.Add(MediaType.Audio);
break;
case CollectionType.Music:
case CollectionType.music:
mediaTypes.Add(MediaType.Audio);
break;
case CollectionType.Photos:
case CollectionType.photos:
mediaTypes.Add(MediaType.Photo);
mediaTypes.Add(MediaType.Video);
break;
case CollectionType.HomeVideos:
case CollectionType.homevideos:
mediaTypes.Add(MediaType.Photo);
mediaTypes.Add(MediaType.Video);
break;

View File

@ -2168,7 +2168,7 @@ namespace Emby.Server.Implementations.LiveTv
public Folder GetInternalLiveTvFolder(CancellationToken cancellationToken)
{
var name = _localization.GetLocalizedString("HeaderLiveTV");
return _libraryManager.GetNamedView(name, CollectionType.LiveTv, name);
return _libraryManager.GetNamedView(name, CollectionType.livetv, name);
}
public async Task<TunerHostInfo> SaveTunerHost(TunerHostInfo info, bool dataSourceChanged = true)

View File

@ -25,7 +25,7 @@ namespace Emby.Server.Implementations.Playlists
public override bool SupportsInheritedParentImages => false;
[JsonIgnore]
public override CollectionType? CollectionType => Jellyfin.Data.Enums.CollectionType.Playlists;
public override CollectionType? CollectionType => Jellyfin.Data.Enums.CollectionType.playlists;
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
{

View File

@ -131,8 +131,8 @@ public class GenresController : BaseJellyfinApiController
QueryResult<(BaseItem, ItemCounts)> result;
if (parentItem is ICollectionFolder parentCollectionFolder
&& (parentCollectionFolder.CollectionType == CollectionType.Music
|| parentCollectionFolder.CollectionType == CollectionType.MusicVideos))
&& (parentCollectionFolder.CollectionType == CollectionType.music
|| parentCollectionFolder.CollectionType == CollectionType.musicvideos))
{
result = _libraryManager.GetMusicGenres(query);
}

View File

@ -171,7 +171,7 @@ public class ItemUpdateController : BaseJellyfinApiController
info.ContentTypeOptions = GetContentTypeOptions(true).ToArray();
info.ContentType = configuredContentType;
if (inheritedContentType is null || inheritedContentType == CollectionType.TvShows)
if (inheritedContentType is null || inheritedContentType == CollectionType.tvshows)
{
info.ContentTypeOptions = info.ContentTypeOptions
.Where(i => string.IsNullOrWhiteSpace(i.Value)

View File

@ -275,7 +275,7 @@ public class ItemsController : BaseJellyfinApiController
collectionType = hasCollectionType.CollectionType;
}
if (collectionType == CollectionType.Playlists)
if (collectionType == CollectionType.playlists)
{
recursive = true;
includeItemTypes = new[] { BaseItemKind.Playlist };

View File

@ -927,15 +927,15 @@ public class LibraryController : BaseJellyfinApiController
{
return contentType switch
{
CollectionType.BoxSets => new[] { "BoxSet" },
CollectionType.Playlists => new[] { "Playlist" },
CollectionType.Movies => new[] { "Movie" },
CollectionType.TvShows => new[] { "Series", "Season", "Episode" },
CollectionType.Books => new[] { "Book" },
CollectionType.Music => new[] { "MusicArtist", "MusicAlbum", "Audio", "MusicVideo" },
CollectionType.HomeVideos => new[] { "Video", "Photo" },
CollectionType.Photos => new[] { "Video", "Photo" },
CollectionType.MusicVideos => new[] { "MusicVideo" },
CollectionType.boxsets => new[] { "BoxSet" },
CollectionType.playlists => new[] { "Playlist" },
CollectionType.movies => new[] { "Movie" },
CollectionType.tvshows => new[] { "Series", "Season", "Episode" },
CollectionType.books => new[] { "Book" },
CollectionType.music => new[] { "MusicArtist", "MusicAlbum", "Audio", "MusicVideo" },
CollectionType.homevideos => new[] { "Video", "Photo" },
CollectionType.photos => new[] { "Video", "Photo" },
CollectionType.musicvideos => new[] { "MusicVideo" },
_ => new[] { "Series", "Season", "Episode", "Movie" }
};
}

View File

@ -1,3 +1,4 @@
#pragma warning disable SA1300 // The name of a C# element does not begin with an upper-case letter. - disabled due to legacy requirement.
using Jellyfin.Data.Attributes;
namespace Jellyfin.Data.Enums;
@ -10,155 +11,155 @@ public enum CollectionType
/// <summary>
/// Unknown collection.
/// </summary>
Unknown = 0,
unknown = 0,
/// <summary>
/// Movies collection.
/// </summary>
Movies = 1,
movies = 1,
/// <summary>
/// Tv shows collection.
/// </summary>
TvShows = 2,
tvshows = 2,
/// <summary>
/// Music collection.
/// </summary>
Music = 3,
music = 3,
/// <summary>
/// Music videos collection.
/// </summary>
MusicVideos = 4,
musicvideos = 4,
/// <summary>
/// Trailers collection.
/// </summary>
Trailers = 5,
trailers = 5,
/// <summary>
/// Home videos collection.
/// </summary>
HomeVideos = 6,
homevideos = 6,
/// <summary>
/// Box sets collection.
/// </summary>
BoxSets = 7,
boxsets = 7,
/// <summary>
/// Books collection.
/// </summary>
Books = 8,
books = 8,
/// <summary>
/// Photos collection.
/// </summary>
Photos = 9,
photos = 9,
/// <summary>
/// Live tv collection.
/// </summary>
LiveTv = 10,
livetv = 10,
/// <summary>
/// Playlists collection.
/// </summary>
Playlists = 11,
playlists = 11,
/// <summary>
/// Folders collection.
/// </summary>
Folders = 12,
folders = 12,
/// <summary>
/// Tv show series collection.
/// </summary>
[OpenApiIgnoreEnum]
TvShowSeries = 101,
tvshowseries = 101,
/// <summary>
/// Tv genres collection.
/// </summary>
[OpenApiIgnoreEnum]
TvGenres = 102,
tvgenres = 102,
/// <summary>
/// Tv genre collection.
/// </summary>
[OpenApiIgnoreEnum]
TvGenre = 103,
tvgenre = 103,
/// <summary>
/// Tv latest collection.
/// </summary>
[OpenApiIgnoreEnum]
TvLatest = 104,
tvlatest = 104,
/// <summary>
/// Tv next up collection.
/// </summary>
[OpenApiIgnoreEnum]
TvNextUp = 105,
tvnextup = 105,
/// <summary>
/// Tv resume collection.
/// </summary>
[OpenApiIgnoreEnum]
TvResume = 106,
tvresume = 106,
/// <summary>
/// Tv favorite series collection.
/// </summary>
[OpenApiIgnoreEnum]
TvFavoriteSeries = 107,
tvfavoriteseries = 107,
/// <summary>
/// Tv favorite episodes collection.
/// </summary>
[OpenApiIgnoreEnum]
TvFavoriteEpisodes = 108,
tvfavoriteepisodes = 108,
/// <summary>
/// Latest movies collection.
/// </summary>
[OpenApiIgnoreEnum]
MovieLatest = 109,
movielatest = 109,
/// <summary>
/// Movies to resume collection.
/// </summary>
[OpenApiIgnoreEnum]
MovieResume = 110,
movieresume = 110,
/// <summary>
/// Movie movie collection.
/// </summary>
[OpenApiIgnoreEnum]
MovieMovies = 111,
moviemovies = 111,
/// <summary>
/// Movie collections collection.
/// </summary>
[OpenApiIgnoreEnum]
MovieCollections = 112,
moviecollection = 112,
/// <summary>
/// Movie favorites collection.
/// </summary>
[OpenApiIgnoreEnum]
MovieFavorites = 113,
moviefavorites = 113,
/// <summary>
/// Movie genres collection.
/// </summary>
[OpenApiIgnoreEnum]
MovieGenres = 114,
moviegenres = 114,
/// <summary>
/// Movie genre collection.
/// </summary>
[OpenApiIgnoreEnum]
MovieGenre = 115
moviegenre = 115
}

View File

@ -724,7 +724,7 @@ namespace MediaBrowser.Controller.Entities
if (this is IHasCollectionType view)
{
if (view.CollectionType == CollectionType.LiveTv)
if (view.CollectionType == CollectionType.livetv)
{
return true;
}

View File

@ -19,19 +19,19 @@ namespace MediaBrowser.Controller.Entities
{
private static readonly CollectionType?[] _viewTypesEligibleForGrouping =
{
Jellyfin.Data.Enums.CollectionType.Movies,
Jellyfin.Data.Enums.CollectionType.TvShows,
Jellyfin.Data.Enums.CollectionType.movies,
Jellyfin.Data.Enums.CollectionType.tvshows,
null
};
private static readonly CollectionType?[] _originalFolderViewTypes =
{
Jellyfin.Data.Enums.CollectionType.Books,
Jellyfin.Data.Enums.CollectionType.MusicVideos,
Jellyfin.Data.Enums.CollectionType.HomeVideos,
Jellyfin.Data.Enums.CollectionType.Photos,
Jellyfin.Data.Enums.CollectionType.Music,
Jellyfin.Data.Enums.CollectionType.BoxSets
Jellyfin.Data.Enums.CollectionType.books,
Jellyfin.Data.Enums.CollectionType.musicvideos,
Jellyfin.Data.Enums.CollectionType.homevideos,
Jellyfin.Data.Enums.CollectionType.photos,
Jellyfin.Data.Enums.CollectionType.music,
Jellyfin.Data.Enums.CollectionType.boxsets
};
public static ITVSeriesManager TVSeriesManager { get; set; }
@ -161,7 +161,7 @@ namespace MediaBrowser.Controller.Entities
return true;
}
return collectionFolder.CollectionType == Jellyfin.Data.Enums.CollectionType.Playlists;
return collectionFolder.CollectionType == Jellyfin.Data.Enums.CollectionType.playlists;
}
public static bool IsEligibleForGrouping(Folder folder)

View File

@ -58,58 +58,58 @@ namespace MediaBrowser.Controller.Entities
switch (viewType)
{
case CollectionType.Folders:
case CollectionType.folders:
return GetResult(_libraryManager.GetUserRootFolder().GetChildren(user, true), query);
case CollectionType.TvShows:
case CollectionType.tvshows:
return GetTvView(queryParent, user, query);
case CollectionType.Movies:
case CollectionType.movies:
return GetMovieFolders(queryParent, user, query);
case CollectionType.TvShowSeries:
case CollectionType.tvshowseries:
return GetTvSeries(queryParent, user, query);
case CollectionType.TvGenres:
case CollectionType.tvgenres:
return GetTvGenres(queryParent, user, query);
case CollectionType.TvGenre:
case CollectionType.tvgenre:
return GetTvGenreItems(queryParent, displayParent, user, query);
case CollectionType.TvResume:
case CollectionType.tvresume:
return GetTvResume(queryParent, user, query);
case CollectionType.TvNextUp:
case CollectionType.tvnextup:
return GetTvNextUp(queryParent, query);
case CollectionType.TvLatest:
case CollectionType.tvlatest:
return GetTvLatest(queryParent, user, query);
case CollectionType.MovieFavorites:
case CollectionType.moviefavorites:
return GetFavoriteMovies(queryParent, user, query);
case CollectionType.MovieLatest:
case CollectionType.movielatest:
return GetMovieLatest(queryParent, user, query);
case CollectionType.MovieGenres:
case CollectionType.moviegenres:
return GetMovieGenres(queryParent, user, query);
case CollectionType.MovieGenre:
case CollectionType.moviegenre:
return GetMovieGenreItems(queryParent, displayParent, user, query);
case CollectionType.MovieResume:
case CollectionType.movieresume:
return GetMovieResume(queryParent, user, query);
case CollectionType.MovieMovies:
case CollectionType.moviemovies:
return GetMovieMovies(queryParent, user, query);
case CollectionType.MovieCollections:
case CollectionType.moviecollection:
return GetMovieCollections(user, query);
case CollectionType.TvFavoriteEpisodes:
case CollectionType.tvfavoriteepisodes:
return GetFavoriteEpisodes(queryParent, user, query);
case CollectionType.TvFavoriteSeries:
case CollectionType.tvfavoriteseries:
return GetFavoriteSeries(queryParent, user, query);
default:
@ -146,12 +146,12 @@ namespace MediaBrowser.Controller.Entities
var list = new List<BaseItem>
{
GetUserView(CollectionType.MovieResume, "HeaderContinueWatching", "0", parent),
GetUserView(CollectionType.MovieLatest, "Latest", "1", parent),
GetUserView(CollectionType.MovieMovies, "Movies", "2", parent),
GetUserView(CollectionType.MovieCollections, "Collections", "3", parent),
GetUserView(CollectionType.MovieFavorites, "Favorites", "4", parent),
GetUserView(CollectionType.MovieGenres, "Genres", "5", parent)
GetUserView(CollectionType.movieresume, "HeaderContinueWatching", "0", parent),
GetUserView(CollectionType.movielatest, "Latest", "1", parent),
GetUserView(CollectionType.moviemovies, "Movies", "2", parent),
GetUserView(CollectionType.moviecollection, "Collections", "3", parent),
GetUserView(CollectionType.moviefavorites, "Favorites", "4", parent),
GetUserView(CollectionType.moviegenres, "Genres", "5", parent)
};
return GetResult(list, query);
@ -264,7 +264,7 @@ namespace MediaBrowser.Controller.Entities
}
})
.Where(i => i is not null)
.Select(i => GetUserViewWithName(CollectionType.MovieGenre, i.SortName, parent));
.Select(i => GetUserViewWithName(CollectionType.moviegenre, i.SortName, parent));
return GetResult(genres, query);
}
@ -303,13 +303,13 @@ namespace MediaBrowser.Controller.Entities
var list = new List<BaseItem>
{
GetUserView(CollectionType.TvResume, "HeaderContinueWatching", "0", parent),
GetUserView(CollectionType.TvNextUp, "HeaderNextUp", "1", parent),
GetUserView(CollectionType.TvLatest, "Latest", "2", parent),
GetUserView(CollectionType.TvShowSeries, "Shows", "3", parent),
GetUserView(CollectionType.TvFavoriteSeries, "HeaderFavoriteShows", "4", parent),
GetUserView(CollectionType.TvFavoriteEpisodes, "HeaderFavoriteEpisodes", "5", parent),
GetUserView(CollectionType.TvGenres, "Genres", "6", parent)
GetUserView(CollectionType.tvresume, "HeaderContinueWatching", "0", parent),
GetUserView(CollectionType.tvnextup, "HeaderNextUp", "1", parent),
GetUserView(CollectionType.tvlatest, "Latest", "2", parent),
GetUserView(CollectionType.tvshowseries, "Shows", "3", parent),
GetUserView(CollectionType.tvfavoriteseries, "HeaderFavoriteShows", "4", parent),
GetUserView(CollectionType.tvfavoriteepisodes, "HeaderFavoriteEpisodes", "5", parent),
GetUserView(CollectionType.tvgenres, "Genres", "6", parent)
};
return GetResult(list, query);
@ -330,7 +330,7 @@ namespace MediaBrowser.Controller.Entities
private QueryResult<BaseItem> GetTvNextUp(Folder parent, InternalItemsQuery query)
{
var parentFolders = GetMediaFolders(parent, query.User, new[] { CollectionType.TvShows });
var parentFolders = GetMediaFolders(parent, query.User, new[] { CollectionType.tvshows });
var result = _tvSeriesManager.GetNextUp(
new NextUpQuery
@ -392,7 +392,7 @@ namespace MediaBrowser.Controller.Entities
}
})
.Where(i => i is not null)
.Select(i => GetUserViewWithName(CollectionType.TvGenre, i.SortName, parent));
.Select(i => GetUserViewWithName(CollectionType.tvgenre, i.SortName, parent));
return GetResult(genres, query);
}

View File

@ -63,7 +63,7 @@ public class AudioResolverTests
null,
Mock.Of<ILibraryManager>())
{
CollectionType = CollectionType.Books,
CollectionType = CollectionType.books,
FileInfo = new FileSystemMetadata
{
FullName = parent,

View File

@ -29,7 +29,7 @@ namespace Jellyfin.Server.Implementations.Tests.Library
null)
{
Parent = parent,
CollectionType = CollectionType.TvShows,
CollectionType = CollectionType.tvshows,
FileInfo = new FileSystemMetadata
{
FullName = "All My Children/Season 01/Extras/All My Children S01E01 - Behind The Scenes.mkv"
@ -52,7 +52,7 @@ namespace Jellyfin.Server.Implementations.Tests.Library
null)
{
Parent = series,
CollectionType = CollectionType.TvShows,
CollectionType = CollectionType.tvshows,
FileInfo = new FileSystemMetadata
{
FullName = "Extras/Extras S01E01.mkv"