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/MediaSegments/MediaSegmentDto.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/MediaSegments/MediaSegmentDto.cs')
| -rw-r--r-- | MediaBrowser.Model/MediaSegments/MediaSegmentDto.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/MediaBrowser.Model/MediaSegments/MediaSegmentDto.cs b/MediaBrowser.Model/MediaSegments/MediaSegmentDto.cs index 6e5c7885c..d9129c395 100644 --- a/MediaBrowser.Model/MediaSegments/MediaSegmentDto.cs +++ b/MediaBrowser.Model/MediaSegments/MediaSegmentDto.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; using Jellyfin.Database.Implementations.Enums; namespace MediaBrowser.Model.MediaSegments; @@ -21,6 +22,7 @@ public class MediaSegmentDto /// <summary> /// Gets or sets the type of content this segment defines. /// </summary> + [DefaultValue(MediaSegmentType.Unknown)] public MediaSegmentType Type { get; set; } /// <summary> |
