mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
Replace == null with is null
This commit is contained in:
@@ -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}");
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace MediaBrowser.MediaEncoding.BdInfo
|
||||
MediaStreams = Array.Empty<MediaStream>()
|
||||
};
|
||||
|
||||
if (playlist == null)
|
||||
if (playlist is null)
|
||||
{
|
||||
return outputStream;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user