diff options
| author | gnattu <gnattu@users.noreply.github.com> | 2025-04-01 07:43:31 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-31 17:43:31 -0600 |
| commit | 4a4fef830eccf0629d7cf955126f0cd78867e0ee (patch) | |
| tree | d75fc86d1c2b88e43f69d19af9aed69d6b6eaaff /MediaBrowser.Model/Search/SearchHint.cs | |
| parent | e9729a536f26a92ccd30cfff4e698e66dbda1adc (diff) | |
Explicitly set default value for enums used in API models (#13821)
Enums in response model with no nullability or default value will make the API very fragile as each extension to the enum will break the API for some clients, but a lot of enums actually do have an unknown value which should be used as a default. This set all model properties that are non-nullable using an enum that has an Unknown member in 10.10, except MediaStream.VideoRangeType which is refactored in #13277
Diffstat (limited to 'MediaBrowser.Model/Search/SearchHint.cs')
| -rw-r--r-- | MediaBrowser.Model/Search/SearchHint.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Search/SearchHint.cs b/MediaBrowser.Model/Search/SearchHint.cs index 2e2979fcf..a18a813cc 100644 --- a/MediaBrowser.Model/Search/SearchHint.cs +++ b/MediaBrowser.Model/Search/SearchHint.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Jellyfin.Data.Enums; namespace MediaBrowser.Model.Search @@ -115,6 +116,7 @@ namespace MediaBrowser.Model.Search /// Gets or sets the type of the media. /// </summary> /// <value>The type of the media.</value> + [DefaultValue(MediaType.Unknown)] public MediaType MediaType { get; set; } /// <summary> |
