aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2023-11-09 14:00:29 -0700
committerGitHub <noreply@github.com>2023-11-09 14:00:29 -0700
commit906f701fa81c7cde1a9a01b066f3f29ff98552a5 (patch)
treeefc92ef0ecf4e535a519de4f8e950a77bb2ad5c3 /Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs
parentc7a94d48ae019f41d5f06340bca7efe0788ad5ad (diff)
Convert CollectionType, SpecialFolderType to enum (#9764)
* Convert CollectionType, SpecialFolderType to enum * Hide internal enum CollectionType values * Apply suggestions from code review Co-authored-by: Shadowghost <Shadowghost@users.noreply.github.com> * Fix recent change * Update Jellyfin.Data/Attributes/OpenApiIgnoreEnumAttribute.cs Co-authored-by: Patrick Barron <barronpm@gmail.com> --------- Co-authored-by: Shadowghost <Shadowghost@users.noreply.github.com> Co-authored-by: Patrick Barron <barronpm@gmail.com>
Diffstat (limited to 'Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs')
-rw-r--r--Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs60
1 files changed, 28 insertions, 32 deletions
diff --git a/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs
index 8a0e627b9..6e8f77977 100644
--- a/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs
+++ b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs
@@ -30,47 +30,43 @@ namespace Emby.Server.Implementations.Images
BaseItemKind[] includeItemTypes;
- if (string.Equals(viewType, CollectionType.Movies, StringComparison.Ordinal))
+ switch (viewType)
{
- includeItemTypes = new[] { BaseItemKind.Movie };
- }
- else if (string.Equals(viewType, CollectionType.TvShows, StringComparison.Ordinal))
- {
- includeItemTypes = new[] { BaseItemKind.Series };
- }
- else if (string.Equals(viewType, CollectionType.Music, StringComparison.Ordinal))
- {
- includeItemTypes = new[] { BaseItemKind.MusicAlbum };
- }
- else if (string.Equals(viewType, CollectionType.MusicVideos, StringComparison.Ordinal))
- {
- includeItemTypes = new[] { BaseItemKind.MusicVideo };
- }
- else if (string.Equals(viewType, CollectionType.Books, StringComparison.Ordinal))
- {
- includeItemTypes = new[] { BaseItemKind.Book, BaseItemKind.AudioBook };
- }
- else if (string.Equals(viewType, CollectionType.BoxSets, StringComparison.Ordinal))
- {
- includeItemTypes = new[] { BaseItemKind.BoxSet };
- }
- else if (string.Equals(viewType, CollectionType.HomeVideos, StringComparison.Ordinal) || string.Equals(viewType, CollectionType.Photos, StringComparison.Ordinal))
- {
- includeItemTypes = new[] { BaseItemKind.Video, BaseItemKind.Photo };
- }
- else
- {
- includeItemTypes = new[] { BaseItemKind.Video, BaseItemKind.Audio, BaseItemKind.Photo, BaseItemKind.Movie, BaseItemKind.Series };
+ case CollectionType.Movies:
+ includeItemTypes = new[] { BaseItemKind.Movie };
+ break;
+ case CollectionType.TvShows:
+ includeItemTypes = new[] { BaseItemKind.Series };
+ break;
+ case CollectionType.Music:
+ includeItemTypes = new[] { BaseItemKind.MusicAlbum };
+ break;
+ case CollectionType.MusicVideos:
+ includeItemTypes = new[] { BaseItemKind.MusicVideo };
+ break;
+ case CollectionType.Books:
+ includeItemTypes = new[] { BaseItemKind.Book, BaseItemKind.AudioBook };
+ break;
+ case CollectionType.BoxSets:
+ includeItemTypes = new[] { BaseItemKind.BoxSet };
+ break;
+ case CollectionType.HomeVideos:
+ case CollectionType.Photos:
+ includeItemTypes = new[] { BaseItemKind.Video, BaseItemKind.Photo };
+ break;
+ default:
+ includeItemTypes = new[] { BaseItemKind.Video, BaseItemKind.Audio, BaseItemKind.Photo, BaseItemKind.Movie, BaseItemKind.Series };
+ break;
}
- var recursive = !string.Equals(CollectionType.Playlists, viewType, StringComparison.OrdinalIgnoreCase);
+ var recursive = viewType != CollectionType.Playlists;
return view.GetItemList(new InternalItemsQuery
{
CollapseBoxSetItems = false,
Recursive = recursive,
DtoOptions = new DtoOptions(false),
- ImageTypes = new ImageType[] { ImageType.Primary },
+ ImageTypes = new[] { ImageType.Primary },
Limit = 8,
OrderBy = new[]
{