diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-12-05 15:00:20 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-12-05 15:00:20 +0100 |
| commit | c7d50d640e614a3c13699e3041fbfcb258861c5a (patch) | |
| tree | 85ce1a16c1af479160b805ec098463ae457b5228 /MediaBrowser.MediaEncoding | |
| parent | b2def4c9ea6cf5e406bf5f865867d6cb5b54f640 (diff) | |
Replace == null with is null
Diffstat (limited to 'MediaBrowser.MediaEncoding')
5 files changed, 13 insertions, 13 deletions
diff --git a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs index 22abf93ac..0ee2bdd38 100644 --- a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs +++ b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs @@ -62,14 +62,14 @@ namespace MediaBrowser.MediaEncoding.Attachments var mediaSources = await _mediaSourceManager.GetPlaybackMediaSources(item, null, true, false, cancellationToken).ConfigureAwait(false); var mediaSource = mediaSources .FirstOrDefault(i => string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase)); - if (mediaSource == null) + if (mediaSource is null) { throw new ResourceNotFoundException($"MediaSource {mediaSourceId} not found"); } var mediaAttachment = mediaSource.MediaAttachments .FirstOrDefault(i => i.Index == attachmentStreamIndex); - if (mediaAttachment == null) + if (mediaAttachment is null) { throw new ResourceNotFoundException($"MediaSource {mediaSourceId} has no attachment with stream index {attachmentStreamIndex}"); } diff --git a/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs b/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs index 6ebaa4fff..bde3d2e84 100644 --- a/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs +++ b/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.MediaEncoding.BdInfo MediaStreams = Array.Empty<MediaStream>() }; - if (playlist == null) + if (playlist is null) { return outputStream; } diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index 8c8fc6b0f..1ae3c976d 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -190,7 +190,7 @@ namespace MediaBrowser.MediaEncoding.Encoder _logger.LogInformation("Found ffmpeg version {Version}", version != null ? version.ToString() : "unknown"); - if (version == null) + if (version is null) { if (MaxVersion != null) // Version is unknown { diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index e50aa679a..9abfb9102 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -531,7 +531,7 @@ namespace MediaBrowser.MediaEncoding.Encoder throw; } - if (result == null || (result.Streams == null && result.Format == null)) + if (result is null || (result.Streams is null && result.Format is null)) { throw new FfmpegException("ffprobe failed - streams and format are both null."); } diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 417f1520f..d5e90e855 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -156,7 +156,7 @@ namespace MediaBrowser.MediaEncoding.Probing else { var artist = tags.GetFirstNotNullNorWhiteSpaceValue("artist"); - info.Artists = artist == null + info.Artists = artist is null ? Array.Empty<string>() : SplitDistinctArtists(artist, _nameDelimiters, true).ToArray(); } @@ -989,7 +989,7 @@ namespace MediaBrowser.MediaEncoding.Probing /// <returns>System.String.</returns> private string GetDictionaryValue(IReadOnlyDictionary<string, string> tags, string key) { - if (tags == null) + if (tags is null) { return null; } @@ -1121,7 +1121,7 @@ namespace MediaBrowser.MediaEncoding.Probing { // Get the first info stream var stream = result.Streams?.FirstOrDefault(s => string.Equals(s.CodecType, "audio", StringComparison.OrdinalIgnoreCase)); - if (stream == null) + if (stream is null) { return; } @@ -1144,7 +1144,7 @@ namespace MediaBrowser.MediaEncoding.Probing private int? GetBPSFromTags(MediaStreamInfo streamInfo) { - if (streamInfo?.Tags == null) + if (streamInfo?.Tags is null) { return null; } @@ -1161,7 +1161,7 @@ namespace MediaBrowser.MediaEncoding.Probing private double? GetRuntimeSecondsFromTags(MediaStreamInfo streamInfo) { - if (streamInfo?.Tags == null) + if (streamInfo?.Tags is null) { return null; } @@ -1177,7 +1177,7 @@ namespace MediaBrowser.MediaEncoding.Probing private long? GetNumberOfBytesFromTags(MediaStreamInfo streamInfo) { - if (streamInfo?.Tags == null) + if (streamInfo?.Tags is null) { return null; } @@ -1195,7 +1195,7 @@ namespace MediaBrowser.MediaEncoding.Probing private void SetSize(InternalMediaInfoResult data, MediaInfo info) { - if (data.Format == null) + if (data.Format is null) { return; } @@ -1510,7 +1510,7 @@ namespace MediaBrowser.MediaEncoding.Probing { var tags = data.Format?.Tags; - if (tags == null) + if (tags is null) { return; } |
