aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
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 /MediaBrowser.Model
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 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs2
-rw-r--r--MediaBrowser.Model/Dto/MetadataEditorInfo.cs3
-rw-r--r--MediaBrowser.Model/Entities/CollectionType.cs27
-rw-r--r--MediaBrowser.Model/Library/UserViewQuery.cs5
4 files changed, 6 insertions, 31 deletions
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 287966dd0e..709039fc5b 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -420,7 +420,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the type of the collection.
/// </summary>
/// <value>The type of the collection.</value>
- public string CollectionType { get; set; }
+ public CollectionType? CollectionType { get; set; }
/// <summary>
/// Gets or sets the display order.
diff --git a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
index d098669baa..a3035bf612 100644
--- a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
+++ b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
+using Jellyfin.Data.Enums;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Providers;
@@ -27,7 +28,7 @@ namespace MediaBrowser.Model.Dto
public IReadOnlyList<ExternalIdInfo> ExternalIdInfos { get; set; }
- public string? ContentType { get; set; }
+ public CollectionType? ContentType { get; set; }
public IReadOnlyList<NameValuePair> ContentTypeOptions { get; set; }
}
diff --git a/MediaBrowser.Model/Entities/CollectionType.cs b/MediaBrowser.Model/Entities/CollectionType.cs
deleted file mode 100644
index 60b69d4b01..0000000000
--- a/MediaBrowser.Model/Entities/CollectionType.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.Entities
-{
- public static class CollectionType
- {
- public const string Movies = "movies";
-
- public const string TvShows = "tvshows";
-
- public const string Music = "music";
-
- public const string MusicVideos = "musicvideos";
-
- public const string Trailers = "trailers";
-
- public const string HomeVideos = "homevideos";
-
- public const string BoxSets = "boxsets";
-
- public const string Books = "books";
- public const string Photos = "photos";
- public const string LiveTv = "livetv";
- public const string Playlists = "playlists";
- public const string Folders = "folders";
- }
-}
diff --git a/MediaBrowser.Model/Library/UserViewQuery.cs b/MediaBrowser.Model/Library/UserViewQuery.cs
index 8a49b68637..e20d6af49e 100644
--- a/MediaBrowser.Model/Library/UserViewQuery.cs
+++ b/MediaBrowser.Model/Library/UserViewQuery.cs
@@ -1,6 +1,7 @@
#pragma warning disable CS1591
using System;
+using Jellyfin.Data.Enums;
namespace MediaBrowser.Model.Library
{
@@ -9,7 +10,7 @@ namespace MediaBrowser.Model.Library
public UserViewQuery()
{
IncludeExternalContent = true;
- PresetViews = Array.Empty<string>();
+ PresetViews = Array.Empty<CollectionType?>();
}
/// <summary>
@@ -30,6 +31,6 @@ namespace MediaBrowser.Model.Library
/// <value><c>true</c> if [include hidden]; otherwise, <c>false</c>.</value>
public bool IncludeHidden { get; set; }
- public string[] PresetViews { get; set; }
+ public CollectionType?[] PresetViews { get; set; }
}
}