aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2022-12-05 15:01:13 +0100
committerBond_009 <bond.009@outlook.com>2022-12-05 15:01:13 +0100
commit52194f56b5f07e3ae01e2fb6d121452e37d1e93f (patch)
treefd638972f72ec49734ad07f831a3aae3b2501a1d /Jellyfin.Api/Controllers
parentc7d50d640e614a3c13699e3041fbfcb258861c5a (diff)
Replace != null with is not null
Diffstat (limited to 'Jellyfin.Api/Controllers')
-rw-r--r--Jellyfin.Api/Controllers/ArtistsController.cs4
-rw-r--r--Jellyfin.Api/Controllers/DynamicHlsController.cs16
-rw-r--r--Jellyfin.Api/Controllers/HlsSegmentController.cs2
-rw-r--r--Jellyfin.Api/Controllers/ImageController.cs10
-rw-r--r--Jellyfin.Api/Controllers/ItemUpdateController.cs18
-rw-r--r--Jellyfin.Api/Controllers/ItemsController.cs6
-rw-r--r--Jellyfin.Api/Controllers/LibraryController.cs12
-rw-r--r--Jellyfin.Api/Controllers/LibraryStructureController.cs2
-rw-r--r--Jellyfin.Api/Controllers/MediaInfoController.cs8
-rw-r--r--Jellyfin.Api/Controllers/PluginsController.cs6
-rw-r--r--Jellyfin.Api/Controllers/SearchController.cs12
-rw-r--r--Jellyfin.Api/Controllers/StartupController.cs2
-rw-r--r--Jellyfin.Api/Controllers/SubtitleController.cs2
-rw-r--r--Jellyfin.Api/Controllers/UserController.cs2
-rw-r--r--Jellyfin.Api/Controllers/UserLibraryController.cs2
-rw-r--r--Jellyfin.Api/Controllers/VideosController.cs4
-rw-r--r--Jellyfin.Api/Controllers/YearsController.cs2
17 files changed, 55 insertions, 55 deletions
diff --git a/Jellyfin.Api/Controllers/ArtistsController.cs b/Jellyfin.Api/Controllers/ArtistsController.cs
index c059cb198..c8ac2ed52 100644
--- a/Jellyfin.Api/Controllers/ArtistsController.cs
+++ b/Jellyfin.Api/Controllers/ArtistsController.cs
@@ -183,7 +183,7 @@ namespace Jellyfin.Api.Controllers
{
return null;
}
- }).Where(i => i != null).Select(i => i!.Id).ToArray();
+ }).Where(i => i is not null).Select(i => i!.Id).ToArray();
}
foreach (var filter in filters)
@@ -386,7 +386,7 @@ namespace Jellyfin.Api.Controllers
{
return null;
}
- }).Where(i => i != null).Select(i => i!.Id).ToArray();
+ }).Where(i => i is not null).Select(i => i!.Id).ToArray();
}
foreach (var filter in filters)
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index afe0de630..af43bb578 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -341,7 +341,7 @@ namespace Jellyfin.Api.Controllers
job ??= _transcodingJobHelper.OnTranscodeBeginRequest(playlistPath, TranscodingJobType);
- if (job != null)
+ if (job is not null)
{
_transcodingJobHelper.OnTranscodeEndRequest(job);
}
@@ -1533,7 +1533,7 @@ namespace Jellyfin.Api.Controllers
else
{
job = _transcodingJobHelper.OnTranscodeBeginRequest(playlistPath, TranscodingJobType);
- if (job?.TranscodingThrottler != null)
+ if (job?.TranscodingThrottler is not null)
{
await job.TranscodingThrottler.UnpauseTranscoding().ConfigureAwait(false);
}
@@ -1806,7 +1806,7 @@ namespace Jellyfin.Api.Controllers
if (EncodingHelper.IsCopyCodec(codec))
{
// If h264_mp4toannexb is ever added, do not use it for live tv.
- if (state.VideoStream != null && !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
+ if (state.VideoStream is not null && !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
{
string bitStreamArgs = EncodingHelper.GetBitStreamArgs(state.VideoStream);
if (!string.IsNullOrEmpty(bitStreamArgs))
@@ -1837,7 +1837,7 @@ namespace Jellyfin.Api.Controllers
// -start_at_zero is necessary to use with -ss when seeking,
// otherwise the target position cannot be determined.
- if (state.SubtitleStream != null)
+ if (state.SubtitleStream is not null)
{
// Disable start_at_zero for external graphical subs
if (!(state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream))
@@ -1883,7 +1883,7 @@ namespace Jellyfin.Api.Controllers
var segmentExists = System.IO.File.Exists(segmentPath);
if (segmentExists)
{
- if (transcodingJob != null && transcodingJob.HasExited)
+ if (transcodingJob is not null && transcodingJob.HasExited)
{
// Transcoding job is over, so assume all existing files are ready
_logger.LogDebug("serving up {0} as transcode is over", segmentPath);
@@ -1901,7 +1901,7 @@ namespace Jellyfin.Api.Controllers
}
var nextSegmentPath = GetSegmentPath(state, playlistPath, segmentIndex + 1);
- if (transcodingJob != null)
+ if (transcodingJob is not null)
{
while (!cancellationToken.IsCancellationRequested && !transcodingJob.HasExited)
{
@@ -1953,7 +1953,7 @@ namespace Jellyfin.Api.Controllers
Response.OnCompleted(() =>
{
_logger.LogDebug("Finished serving {SegmentPath}", segmentPath);
- if (transcodingJob != null)
+ if (transcodingJob is not null)
{
transcodingJob.DownloadPositionTicks = Math.Max(transcodingJob.DownloadPositionTicks ?? segmentEndingPositionTicks, segmentEndingPositionTicks);
_transcodingJobHelper.OnTranscodeEndRequest(transcodingJob);
@@ -2011,7 +2011,7 @@ namespace Jellyfin.Api.Controllers
{
var file = GetLastTranscodingFile(playlistPath, segmentExtension, _fileSystem);
- if (file != null)
+ if (file is not null)
{
DeleteFile(file.FullName, retryCount);
}
diff --git a/Jellyfin.Api/Controllers/HlsSegmentController.cs b/Jellyfin.Api/Controllers/HlsSegmentController.cs
index 8e78d5a1a..50fee233a 100644
--- a/Jellyfin.Api/Controllers/HlsSegmentController.cs
+++ b/Jellyfin.Api/Controllers/HlsSegmentController.cs
@@ -178,7 +178,7 @@ namespace Jellyfin.Api.Controllers
Response.OnCompleted(() =>
{
- if (transcodingJob != null)
+ if (transcodingJob is not null)
{
_transcodingJobHelper.OnTranscodeEndRequest(transcodingJob);
}
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs
index adcac8e97..260b9536e 100644
--- a/Jellyfin.Api/Controllers/ImageController.cs
+++ b/Jellyfin.Api/Controllers/ImageController.cs
@@ -110,7 +110,7 @@ namespace Jellyfin.Api.Controllers
// Handle image/png; charset=utf-8
var mimeType = Request.ContentType?.Split(';').FirstOrDefault();
var userDataPath = Path.Combine(_serverConfigurationManager.ApplicationPaths.UserConfigurationDirectoryPath, user.Username);
- if (user.ProfileImage != null)
+ if (user.ProfileImage is not null)
{
await _userManager.ClearProfileImageAsync(user).ConfigureAwait(false);
}
@@ -157,7 +157,7 @@ namespace Jellyfin.Api.Controllers
// Handle image/png; charset=utf-8
var mimeType = Request.ContentType?.Split(';').FirstOrDefault();
var userDataPath = Path.Combine(_serverConfigurationManager.ApplicationPaths.UserConfigurationDirectoryPath, user.Username);
- if (user.ProfileImage != null)
+ if (user.ProfileImage is not null)
{
await _userManager.ClearProfileImageAsync(user).ConfigureAwait(false);
}
@@ -452,7 +452,7 @@ namespace Jellyfin.Api.Controllers
{
var info = GetImageInfo(item, image, null);
- if (info != null)
+ if (info is not null)
{
list.Add(info);
}
@@ -470,7 +470,7 @@ namespace Jellyfin.Api.Controllers
{
var info = GetImageInfo(item, image, index);
- if (info != null)
+ if (info is not null)
{
list.Add(info);
}
@@ -1968,7 +1968,7 @@ namespace Jellyfin.Api.Controllers
{ "realTimeInfo.dlna.org", "DLNA.ORG_TLAG=*" }
};
- if (!imageInfo.IsLocalFile && item != null)
+ if (!imageInfo.IsLocalFile && item is not null)
{
imageInfo = await _libraryManager.ConvertImageToLocal(item, imageInfo, imageIndex ?? 0).ConfigureAwait(false);
}
diff --git a/Jellyfin.Api/Controllers/ItemUpdateController.cs b/Jellyfin.Api/Controllers/ItemUpdateController.cs
index 5f992f033..af3d779f5 100644
--- a/Jellyfin.Api/Controllers/ItemUpdateController.cs
+++ b/Jellyfin.Api/Controllers/ItemUpdateController.cs
@@ -80,13 +80,13 @@ namespace Jellyfin.Api.Controllers
var isLockedChanged = item.IsLocked != newLockData;
var series = item as Series;
- var displayOrderChanged = series != null && !string.Equals(
+ var displayOrderChanged = series is not null && !string.Equals(
series.DisplayOrder ?? string.Empty,
request.DisplayOrder ?? string.Empty,
StringComparison.OrdinalIgnoreCase);
// Do this first so that metadata savers can pull the updates from the database.
- if (request.People != null)
+ if (request.People is not null)
{
_libraryManager.UpdatePeople(
item,
@@ -248,12 +248,12 @@ namespace Jellyfin.Api.Controllers
item.Tags = request.Tags;
- if (request.Taglines != null)
+ if (request.Taglines is not null)
{
item.Tagline = request.Taglines.FirstOrDefault();
}
- if (request.Studios != null)
+ if (request.Studios is not null)
{
item.Studios = request.Studios.Select(x => x.Name).ToArray();
}
@@ -269,7 +269,7 @@ namespace Jellyfin.Api.Controllers
item.OfficialRating = string.IsNullOrWhiteSpace(request.OfficialRating) ? null : request.OfficialRating;
item.CustomRating = request.CustomRating;
- if (request.ProductionLocations != null)
+ if (request.ProductionLocations is not null)
{
item.ProductionLocations = request.ProductionLocations;
}
@@ -289,7 +289,7 @@ namespace Jellyfin.Api.Controllers
item.IsLocked = request.LockData ?? false;
- if (request.LockedFields != null)
+ if (request.LockedFields is not null)
{
item.LockedFields = request.LockedFields;
}
@@ -315,7 +315,7 @@ namespace Jellyfin.Api.Controllers
video.Video3DFormat = request.Video3DFormat;
}
- if (request.AlbumArtists != null)
+ if (request.AlbumArtists is not null)
{
if (item is IHasAlbumArtist hasAlbumArtists)
{
@@ -326,7 +326,7 @@ namespace Jellyfin.Api.Controllers
}
}
- if (request.ArtistItems != null)
+ if (request.ArtistItems is not null)
{
if (item is IHasArtist hasArtists)
{
@@ -349,7 +349,7 @@ namespace Jellyfin.Api.Controllers
{
series.Status = GetSeriesStatus(request);
- if (request.AirDays != null)
+ if (request.AirDays is not null)
{
series.AirDays = request.AirDays;
series.AirTime = request.AirTime;
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 3ee5b8d73..717ddc32b 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -447,7 +447,7 @@ namespace Jellyfin.Api.Controllers
{
return null;
}
- }).Where(i => i != null).Select(i => i!.Id).ToArray();
+ }).Where(i => i is not null).Select(i => i!.Id).ToArray();
}
// ExcludeArtistIds
@@ -483,7 +483,7 @@ namespace Jellyfin.Api.Controllers
{
return null;
}
- }).Where(i => i != null).Select(i => i!.Id).ToArray();
+ }).Where(i => i is not null).Select(i => i!.Id).ToArray();
}
// Apply default sorting if none requested
@@ -837,7 +837,7 @@ namespace Jellyfin.Api.Controllers
if (excludeActiveSessions)
{
excludeItemIds = _sessionManager.Sessions
- .Where(s => s.UserId.Equals(userId) && s.NowPlayingItem != null)
+ .Where(s => s.UserId.Equals(userId) && s.NowPlayingItem is not null)
.Select(s => s.NowPlayingItem.Id)
.ToArray();
}
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs
index 80d1c008b..ab2020830 100644
--- a/Jellyfin.Api/Controllers/LibraryController.cs
+++ b/Jellyfin.Api/Controllers/LibraryController.cs
@@ -449,9 +449,9 @@ namespace Jellyfin.Api.Controllers
var dtoOptions = new DtoOptions().AddClientFields(User);
BaseItem? parent = item.GetParent();
- while (parent != null)
+ while (parent is not null)
{
- if (user != null)
+ if (user is not null)
{
parent = TranslateParentItem(parent, user);
}
@@ -617,7 +617,7 @@ namespace Jellyfin.Api.Controllers
var user = _userManager.GetUserById(User.GetUserId());
- if (user != null)
+ if (user is not null)
{
if (!item.CanDownload(user))
{
@@ -632,7 +632,7 @@ namespace Jellyfin.Api.Controllers
}
}
- if (user != null)
+ if (user is not null)
{
await LogDownloadAsync(item, user).ConfigureAwait(false);
}
@@ -686,8 +686,8 @@ namespace Jellyfin.Api.Controllers
.AddClientFields(User);
var program = item as IHasProgramAttributes;
- bool? isMovie = item is Movie || (program != null && program.IsMovie) || item is Trailer;
- bool? isSeries = item is Series || (program != null && program.IsSeries);
+ bool? isMovie = item is Movie || (program is not null && program.IsMovie) || item is Trailer;
+ bool? isSeries = item is Series || (program is not null && program.IsSeries);
var includeItemTypes = new List<BaseItemKind>();
if (isMovie.Value)
diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.cs
index ec1170411..1c2394055 100644
--- a/Jellyfin.Api/Controllers/LibraryStructureController.cs
+++ b/Jellyfin.Api/Controllers/LibraryStructureController.cs
@@ -82,7 +82,7 @@ namespace Jellyfin.Api.Controllers
{
var libraryOptions = libraryOptionsDto?.LibraryOptions ?? new LibraryOptions();
- if (paths != null && paths.Length > 0)
+ if (paths is not null && paths.Length > 0)
{
libraryOptions.PathInfos = paths.Select(i => new MediaPathInfo(i)).ToArray();
}
diff --git a/Jellyfin.Api/Controllers/MediaInfoController.cs b/Jellyfin.Api/Controllers/MediaInfoController.cs
index be6453af9..8115c3585 100644
--- a/Jellyfin.Api/Controllers/MediaInfoController.cs
+++ b/Jellyfin.Api/Controllers/MediaInfoController.cs
@@ -124,7 +124,7 @@ namespace Jellyfin.Api.Controllers
if (profile is null)
{
var caps = _deviceManager.GetCapabilities(User.GetDeviceId());
- if (caps != null)
+ if (caps is not null)
{
profile = caps.DeviceProfile;
}
@@ -154,12 +154,12 @@ namespace Jellyfin.Api.Controllers
liveStreamId)
.ConfigureAwait(false);
- if (info.ErrorCode != null)
+ if (info.ErrorCode is not null)
{
return info;
}
- if (profile != null)
+ if (profile is not null)
{
// set device specific data
var item = _libraryManager.GetItemById(itemId);
@@ -194,7 +194,7 @@ namespace Jellyfin.Api.Controllers
{
var mediaSource = string.IsNullOrWhiteSpace(mediaSourceId) ? info.MediaSources[0] : info.MediaSources.FirstOrDefault(i => string.Equals(i.Id, mediaSourceId, StringComparison.Ordinal));
- if (mediaSource != null && mediaSource.RequiresOpening && string.IsNullOrWhiteSpace(mediaSource.LiveStreamId))
+ if (mediaSource is not null && mediaSource.RequiresOpening && string.IsNullOrWhiteSpace(mediaSource.LiveStreamId))
{
var openStreamResult = await _mediaInfoHelper.OpenMediaSource(
HttpContext,
diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.cs
index 361828fbd..6a729b237 100644
--- a/Jellyfin.Api/Controllers/PluginsController.cs
+++ b/Jellyfin.Api/Controllers/PluginsController.cs
@@ -148,7 +148,7 @@ namespace Jellyfin.Api.Controllers
// Select the un-instanced one first.
var plugin = plugins.FirstOrDefault(p => p.Instance is null) ?? plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault();
- if (plugin != null)
+ if (plugin is not null)
{
_installationManager.UninstallPlugin(plugin);
return NoContent();
@@ -202,7 +202,7 @@ namespace Jellyfin.Api.Controllers
var configuration = (BasePluginConfiguration?)await JsonSerializer.DeserializeAsync(Request.Body, configPlugin.ConfigurationType, _serializerOptions)
.ConfigureAwait(false);
- if (configuration != null)
+ if (configuration is not null)
{
configPlugin.UpdateConfiguration(configuration);
}
@@ -254,7 +254,7 @@ namespace Jellyfin.Api.Controllers
{
var plugin = _pluginManager.GetPlugin(pluginId);
- if (plugin != null)
+ if (plugin is not null)
{
return plugin.Manifest;
}
diff --git a/Jellyfin.Api/Controllers/SearchController.cs b/Jellyfin.Api/Controllers/SearchController.cs
index 3c0603a19..3b7719f37 100644
--- a/Jellyfin.Api/Controllers/SearchController.cs
+++ b/Jellyfin.Api/Controllers/SearchController.cs
@@ -161,7 +161,7 @@ namespace Jellyfin.Api.Controllers
var primaryImageTag = _imageProcessor.GetImageCacheTag(item, ImageType.Primary);
- if (primaryImageTag != null)
+ if (primaryImageTag is not null)
{
result.PrimaryImageTag = primaryImageTag;
result.PrimaryImageAspectRatio = _dtoService.GetPrimaryImageAspectRatio(item);
@@ -195,7 +195,7 @@ namespace Jellyfin.Api.Controllers
MusicAlbum musicAlbum = song.AlbumEntity;
- if (musicAlbum != null)
+ if (musicAlbum is not null)
{
result.Album = musicAlbum.Name;
result.AlbumId = musicAlbum.Id;
@@ -228,11 +228,11 @@ namespace Jellyfin.Api.Controllers
itemWithImage ??= GetParentWithImage<BaseItem>(item, ImageType.Thumb);
- if (itemWithImage != null)
+ if (itemWithImage is not null)
{
var tag = _imageProcessor.GetImageCacheTag(itemWithImage, ImageType.Thumb);
- if (tag != null)
+ if (tag is not null)
{
hint.ThumbImageTag = tag;
hint.ThumbImageItemId = itemWithImage.Id.ToString("N", CultureInfo.InvariantCulture);
@@ -245,11 +245,11 @@ namespace Jellyfin.Api.Controllers
var itemWithImage = (item.HasImage(ImageType.Backdrop) ? item : null)
?? GetParentWithImage<BaseItem>(item, ImageType.Backdrop);
- if (itemWithImage != null)
+ if (itemWithImage is not null)
{
var tag = _imageProcessor.GetImageCacheTag(itemWithImage, ImageType.Backdrop);
- if (tag != null)
+ if (tag is not null)
{
hint.BackdropImageTag = tag;
hint.BackdropImageItemId = itemWithImage.Id.ToString("N", CultureInfo.InvariantCulture);
diff --git a/Jellyfin.Api/Controllers/StartupController.cs b/Jellyfin.Api/Controllers/StartupController.cs
index c49bde93f..eec5779e6 100644
--- a/Jellyfin.Api/Controllers/StartupController.cs
+++ b/Jellyfin.Api/Controllers/StartupController.cs
@@ -132,7 +132,7 @@ namespace Jellyfin.Api.Controllers
{
var user = _userManager.Users.First();
- if (startupUserDto.Name != null)
+ if (startupUserDto.Name is not null)
{
user.Username = startupUserDto.Name;
}
diff --git a/Jellyfin.Api/Controllers/SubtitleController.cs b/Jellyfin.Api/Controllers/SubtitleController.cs
index b9c2a8ad8..ff9bd095b 100644
--- a/Jellyfin.Api/Controllers/SubtitleController.cs
+++ b/Jellyfin.Api/Controllers/SubtitleController.cs
@@ -522,7 +522,7 @@ namespace Jellyfin.Api.Controllers
.First(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase));
var fileSize = fontFile?.Length;
- if (fontFile != null && fileSize != null && fileSize > 0)
+ if (fontFile is not null && fileSize is not null && fileSize > 0)
{
_logger.LogDebug("Fallback font size is {FileSize} Bytes", fileSize);
return PhysicalFile(fontFile.FullName, MimeTypes.GetMimeType(fontFile.FullName));
diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.cs
index 4ee3361b5..002327d74 100644
--- a/Jellyfin.Api/Controllers/UserController.cs
+++ b/Jellyfin.Api/Controllers/UserController.cs
@@ -477,7 +477,7 @@ namespace Jellyfin.Api.Controllers
var newUser = await _userManager.CreateUserAsync(request.Name).ConfigureAwait(false);
// no need to authenticate password for new user
- if (request.Password != null)
+ if (request.Password is not null)
{
await _userManager.ChangePassword(newUser, request.Password).ConfigureAwait(false);
}
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 60e190616..c18fa29af 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -306,7 +306,7 @@ namespace Jellyfin.Api.Controllers
var item = i.Item2[0];
var childCount = 0;
- if (i.Item1 != null && (i.Item2.Count > 1 || i.Item1 is MusicAlbum))
+ if (i.Item1 is not null && (i.Item2.Count > 1 || i.Item1 is MusicAlbum))
{
item = i.Item1;
childCount = i.Item2.Count;
diff --git a/Jellyfin.Api/Controllers/VideosController.cs b/Jellyfin.Api/Controllers/VideosController.cs
index 17e556730..64d8fb498 100644
--- a/Jellyfin.Api/Controllers/VideosController.cs
+++ b/Jellyfin.Api/Controllers/VideosController.cs
@@ -439,7 +439,7 @@ namespace Jellyfin.Api.Controllers
cancellationTokenSource.Token)
.ConfigureAwait(false);
- if (@static.HasValue && @static.Value && state.DirectStreamProvider != null)
+ if (@static.HasValue && @static.Value && state.DirectStreamProvider is not null)
{
StreamingHelpers.AddDlnaHeaders(state, Response.Headers, true, state.Request.StartTimeTicks, Request, _dlnaManager);
@@ -472,7 +472,7 @@ namespace Jellyfin.Api.Controllers
var outputPathExists = System.IO.File.Exists(outputPath);
var transcodingJob = _transcodingJobHelper.GetTranscodingJob(outputPath, TranscodingJobType.Progressive);
- var isTranscodeCached = outputPathExists && transcodingJob != null;
+ var isTranscodeCached = outputPathExists && transcodingJob is not null;
StreamingHelpers.AddDlnaHeaders(state, Response.Headers, (@static.HasValue && @static.Value) || isTranscodeCached, state.Request.StartTimeTicks, Request, _dlnaManager);
diff --git a/Jellyfin.Api/Controllers/YearsController.cs b/Jellyfin.Api/Controllers/YearsController.cs
index f8193f19a..cd85ba221 100644
--- a/Jellyfin.Api/Controllers/YearsController.cs
+++ b/Jellyfin.Api/Controllers/YearsController.cs
@@ -152,7 +152,7 @@ namespace Jellyfin.Api.Controllers
var result = new QueryResult<BaseItemDto>(
startIndex,
ibnItemsArray.Count,
- dtos.Where(i => i != null).ToArray());
+ dtos.Where(i => i is not null).ToArray());
return result;
}