diff options
| author | Maxr1998 <max.rumpf1998@gmail.com> | 2021-05-01 13:06:10 +0200 |
|---|---|---|
| committer | Maxr1998 <max.rumpf1998@gmail.com> | 2021-05-01 13:06:10 +0200 |
| commit | 70771fdcd60ec5d8a9f13713662778c7e57d0633 (patch) | |
| tree | b532642f0044f25c536423435253ee313db4b65a /MediaBrowser.Model/Dlna/DirectPlayProfile.cs | |
| parent | 360d80c873c04a9f61ded160615f161bfcdb4f74 (diff) | |
Nullability handling for device profile classes
Diffstat (limited to 'MediaBrowser.Model/Dlna/DirectPlayProfile.cs')
| -rw-r--r-- | MediaBrowser.Model/Dlna/DirectPlayProfile.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs index 88cb83991..417d915b5 100644 --- a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs +++ b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs @@ -1,6 +1,6 @@ -#nullable disable #pragma warning disable CS1591 +using System.ComponentModel.DataAnnotations; using System.Xml.Serialization; namespace MediaBrowser.Model.Dlna @@ -8,14 +8,15 @@ namespace MediaBrowser.Model.Dlna public class DirectPlayProfile { [XmlAttribute("container")] - public string Container { get; set; } + public string? Container { get; set; } [XmlAttribute("audioCodec")] - public string AudioCodec { get; set; } + public string? AudioCodec { get; set; } [XmlAttribute("videoCodec")] - public string VideoCodec { get; set; } + public string? VideoCodec { get; set; } + [Required] [XmlAttribute("type")] public DlnaProfileType Type { get; set; } @@ -31,7 +32,7 @@ namespace MediaBrowser.Model.Dlna public bool SupportsAudioCodec(string codec) { - return (Type == DlnaProfileType.Audio || Type == DlnaProfileType.Video) && ContainerProfile.ContainsContainer(AudioCodec, codec); + return (Type is DlnaProfileType.Audio or DlnaProfileType.Video) && ContainerProfile.ContainsContainer(AudioCodec, codec); } } } |
