aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api/Controllers')
-rw-r--r--Jellyfin.Api/Controllers/ConfigurationController.cs2
-rw-r--r--Jellyfin.Api/Controllers/DashboardController.cs4
-rw-r--r--Jellyfin.Api/Controllers/DevicesController.cs6
-rw-r--r--Jellyfin.Api/Controllers/DlnaController.cs6
-rw-r--r--Jellyfin.Api/Controllers/DlnaServerController.cs2
-rw-r--r--Jellyfin.Api/Controllers/DynamicHlsController.cs10
-rw-r--r--Jellyfin.Api/Controllers/EnvironmentController.cs2
-rw-r--r--Jellyfin.Api/Controllers/FilterController.cs2
-rw-r--r--Jellyfin.Api/Controllers/HlsSegmentController.cs2
-rw-r--r--Jellyfin.Api/Controllers/ImageByNameController.cs2
-rw-r--r--Jellyfin.Api/Controllers/ImageController.cs48
-rw-r--r--Jellyfin.Api/Controllers/ItemLookupController.cs2
-rw-r--r--Jellyfin.Api/Controllers/ItemRefreshController.cs2
-rw-r--r--Jellyfin.Api/Controllers/ItemUpdateController.cs4
-rw-r--r--Jellyfin.Api/Controllers/LibraryController.cs14
-rw-r--r--Jellyfin.Api/Controllers/LiveTvController.cs6
-rw-r--r--Jellyfin.Api/Controllers/MediaInfoController.cs2
-rw-r--r--Jellyfin.Api/Controllers/PackageController.cs4
-rw-r--r--Jellyfin.Api/Controllers/PersonsController.cs2
-rw-r--r--Jellyfin.Api/Controllers/PlaylistsController.cs2
-rw-r--r--Jellyfin.Api/Controllers/PlaystateController.cs2
-rw-r--r--Jellyfin.Api/Controllers/PluginsController.cs12
-rw-r--r--Jellyfin.Api/Controllers/RemoteImageController.cs6
-rw-r--r--Jellyfin.Api/Controllers/ScheduledTasksController.cs8
-rw-r--r--Jellyfin.Api/Controllers/SearchController.cs2
-rw-r--r--Jellyfin.Api/Controllers/SessionController.cs2
-rw-r--r--Jellyfin.Api/Controllers/SubtitleController.cs2
-rw-r--r--Jellyfin.Api/Controllers/TvShowsController.cs2
-rw-r--r--Jellyfin.Api/Controllers/UserController.cs12
-rw-r--r--Jellyfin.Api/Controllers/UserLibraryController.cs4
-rw-r--r--Jellyfin.Api/Controllers/UserViewsController.cs2
-rw-r--r--Jellyfin.Api/Controllers/VideoAttachmentsController.cs2
-rw-r--r--Jellyfin.Api/Controllers/VideosController.cs6
-rw-r--r--Jellyfin.Api/Controllers/YearsController.cs2
34 files changed, 94 insertions, 94 deletions
diff --git a/Jellyfin.Api/Controllers/ConfigurationController.cs b/Jellyfin.Api/Controllers/ConfigurationController.cs
index bbe163312..a00ac1b0a 100644
--- a/Jellyfin.Api/Controllers/ConfigurationController.cs
+++ b/Jellyfin.Api/Controllers/ConfigurationController.cs
@@ -96,7 +96,7 @@ namespace Jellyfin.Api.Controllers
var configurationType = _configurationManager.GetConfigurationType(key);
var deserializedConfiguration = configuration.Deserialize(configurationType, _serializerOptions);
- if (deserializedConfiguration == null)
+ if (deserializedConfiguration is null)
{
throw new ArgumentException("Body doesn't contain a valid configuration");
}
diff --git a/Jellyfin.Api/Controllers/DashboardController.cs b/Jellyfin.Api/Controllers/DashboardController.cs
index c8411f44b..3894e6c5f 100644
--- a/Jellyfin.Api/Controllers/DashboardController.cs
+++ b/Jellyfin.Api/Controllers/DashboardController.cs
@@ -76,7 +76,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult GetDashboardConfigurationPage([FromQuery] string? name)
{
var altPage = GetPluginPages().FirstOrDefault(p => string.Equals(p.Item1.Name, name, StringComparison.OrdinalIgnoreCase));
- if (altPage == null)
+ if (altPage is null)
{
return NotFound();
}
@@ -84,7 +84,7 @@ namespace Jellyfin.Api.Controllers
IPlugin plugin = altPage.Item2;
string resourcePath = altPage.Item1.EmbeddedResourcePath;
Stream? stream = plugin.GetType().Assembly.GetManifestResourceStream(resourcePath);
- if (stream == null)
+ if (stream is null)
{
_logger.LogError("Failed to get resource {Resource} from plugin {Plugin}", resourcePath, plugin.Name);
return NotFound();
diff --git a/Jellyfin.Api/Controllers/DevicesController.cs b/Jellyfin.Api/Controllers/DevicesController.cs
index 8292cf83b..aad60cf5c 100644
--- a/Jellyfin.Api/Controllers/DevicesController.cs
+++ b/Jellyfin.Api/Controllers/DevicesController.cs
@@ -64,7 +64,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult<DeviceInfo>> GetDeviceInfo([FromQuery, Required] string id)
{
var deviceInfo = await _deviceManager.GetDevice(id).ConfigureAwait(false);
- if (deviceInfo == null)
+ if (deviceInfo is null)
{
return NotFound();
}
@@ -85,7 +85,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult<DeviceOptions>> GetDeviceOptions([FromQuery, Required] string id)
{
var deviceInfo = await _deviceManager.GetDeviceOptions(id).ConfigureAwait(false);
- if (deviceInfo == null)
+ if (deviceInfo is null)
{
return NotFound();
}
@@ -123,7 +123,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult> DeleteDevice([FromQuery, Required] string id)
{
var existingDevice = await _deviceManager.GetDevice(id).ConfigureAwait(false);
- if (existingDevice == null)
+ if (existingDevice is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/DlnaController.cs b/Jellyfin.Api/Controllers/DlnaController.cs
index 35c3a3d92..07e0590a1 100644
--- a/Jellyfin.Api/Controllers/DlnaController.cs
+++ b/Jellyfin.Api/Controllers/DlnaController.cs
@@ -63,7 +63,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult<DeviceProfile> GetProfile([FromRoute, Required] string profileId)
{
var profile = _dlnaManager.GetProfile(profileId);
- if (profile == null)
+ if (profile is null)
{
return NotFound();
}
@@ -84,7 +84,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult DeleteProfile([FromRoute, Required] string profileId)
{
var existingDeviceProfile = _dlnaManager.GetProfile(profileId);
- if (existingDeviceProfile == null)
+ if (existingDeviceProfile is null)
{
return NotFound();
}
@@ -121,7 +121,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult UpdateProfile([FromRoute, Required] string profileId, [FromBody] DeviceProfile deviceProfile)
{
var existingDeviceProfile = _dlnaManager.GetProfile(profileId);
- if (existingDeviceProfile == null)
+ if (existingDeviceProfile is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/DlnaServerController.cs b/Jellyfin.Api/Controllers/DlnaServerController.cs
index 8859d6020..96c492b3e 100644
--- a/Jellyfin.Api/Controllers/DlnaServerController.cs
+++ b/Jellyfin.Api/Controllers/DlnaServerController.cs
@@ -274,7 +274,7 @@ namespace Jellyfin.Api.Controllers
private ActionResult GetIconInternal(string fileName)
{
var icon = _dlnaManager.GetIcon(fileName);
- if (icon == null)
+ if (icon is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 0f4d3c1eb..afe0de630 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -1482,7 +1482,7 @@ namespace Jellyfin.Api.Controllers
startTranscoding = true;
segmentId = 0;
}
- else if (currentTranscodingIndex == null)
+ else if (currentTranscodingIndex is null)
{
_logger.LogDebug("Starting transcoding because currentTranscodingIndex=null");
startTranscoding = true;
@@ -1665,7 +1665,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>The command line arguments for audio transcoding.</returns>
private string GetAudioArguments(StreamState state)
{
- if (state.AudioStream == null)
+ if (state.AudioStream is null)
{
return string.Empty;
}
@@ -1762,7 +1762,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>The command line arguments for video transcoding.</returns>
private string GetVideoArguments(StreamState state, int startNumber, bool isEventPlaylist)
{
- if (state.VideoStream == null)
+ if (state.VideoStream is null)
{
return string.Empty;
}
@@ -1969,14 +1969,14 @@ namespace Jellyfin.Api.Controllers
{
var job = _transcodingJobHelper.GetTranscodingJob(playlist, TranscodingJobType);
- if (job == null || job.HasExited)
+ if (job is null || job.HasExited)
{
return null;
}
var file = GetLastTranscodingFile(playlist, segmentExtension, _fileSystem);
- if (file == null)
+ if (file is null)
{
return null;
}
diff --git a/Jellyfin.Api/Controllers/EnvironmentController.cs b/Jellyfin.Api/Controllers/EnvironmentController.cs
index b0b4b5af5..6c78a7987 100644
--- a/Jellyfin.Api/Controllers/EnvironmentController.cs
+++ b/Jellyfin.Api/Controllers/EnvironmentController.cs
@@ -104,7 +104,7 @@ namespace Jellyfin.Api.Controllers
if (validatePathDto.ValidateWritable)
{
- if (validatePathDto.Path == null)
+ if (validatePathDto.Path is null)
{
throw new ResourceNotFoundException(nameof(validatePathDto.Path));
}
diff --git a/Jellyfin.Api/Controllers/FilterController.cs b/Jellyfin.Api/Controllers/FilterController.cs
index 11808b1b8..b6780ee20 100644
--- a/Jellyfin.Api/Controllers/FilterController.cs
+++ b/Jellyfin.Api/Controllers/FilterController.cs
@@ -182,7 +182,7 @@ namespace Jellyfin.Api.Controllers
if ((recursive ?? true) || parentItem is UserView || parentItem is ICollectionFolder)
{
- genreQuery.AncestorIds = parentItem == null ? Array.Empty<Guid>() : new[] { parentItem.Id };
+ genreQuery.AncestorIds = parentItem is null ? Array.Empty<Guid>() : new[] { parentItem.Id };
}
else
{
diff --git a/Jellyfin.Api/Controllers/HlsSegmentController.cs b/Jellyfin.Api/Controllers/HlsSegmentController.cs
index 78634f0bf..8e78d5a1a 100644
--- a/Jellyfin.Api/Controllers/HlsSegmentController.cs
+++ b/Jellyfin.Api/Controllers/HlsSegmentController.cs
@@ -167,7 +167,7 @@ namespace Jellyfin.Api.Controllers
}
}
- return playlistPath == null
+ return playlistPath is null
? NotFound("Hls segment not found.")
: GetFileResult(file, playlistPath);
}
diff --git a/Jellyfin.Api/Controllers/ImageByNameController.cs b/Jellyfin.Api/Controllers/ImageByNameController.cs
index 89bbf22c9..c54851b96 100644
--- a/Jellyfin.Api/Controllers/ImageByNameController.cs
+++ b/Jellyfin.Api/Controllers/ImageByNameController.cs
@@ -77,7 +77,7 @@ namespace Jellyfin.Api.Controllers
.Select(i => Path.GetFullPath(Path.Combine(_applicationPaths.GeneralPath, name, filename + i)))
.FirstOrDefault(System.IO.File.Exists);
- if (path == null)
+ if (path is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs
index f092bd882..adcac8e97 100644
--- a/Jellyfin.Api/Controllers/ImageController.cs
+++ b/Jellyfin.Api/Controllers/ImageController.cs
@@ -198,7 +198,7 @@ namespace Jellyfin.Api.Controllers
}
var user = _userManager.GetUserById(userId);
- if (user?.ProfileImage == null)
+ if (user?.ProfileImage is null)
{
return NoContent();
}
@@ -242,7 +242,7 @@ namespace Jellyfin.Api.Controllers
}
var user = _userManager.GetUserById(userId);
- if (user?.ProfileImage == null)
+ if (user?.ProfileImage is null)
{
return NoContent();
}
@@ -279,7 +279,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageIndex)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -307,7 +307,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute] int imageIndex)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -335,7 +335,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] ImageType imageType)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -371,7 +371,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute] int imageIndex)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -407,7 +407,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery, Required] int newIndex)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -430,7 +430,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult<IEnumerable<ImageInfo>>> GetItemImageInfos([FromRoute, Required] Guid itemId)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -537,7 +537,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageIndex)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -620,7 +620,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? foregroundLayer)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -703,7 +703,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] int imageIndex)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -786,7 +786,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] int imageIndex)
{
var item = _libraryManager.GetArtist(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -869,7 +869,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageIndex)
{
var item = _libraryManager.GetGenre(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -952,7 +952,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? foregroundLayer)
{
var item = _libraryManager.GetGenre(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -1035,7 +1035,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageIndex)
{
var item = _libraryManager.GetMusicGenre(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -1118,7 +1118,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? foregroundLayer)
{
var item = _libraryManager.GetMusicGenre(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -1201,7 +1201,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageIndex)
{
var item = _libraryManager.GetPerson(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -1284,7 +1284,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? foregroundLayer)
{
var item = _libraryManager.GetPerson(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -1367,7 +1367,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageIndex)
{
var item = _libraryManager.GetStudio(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -1450,7 +1450,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? foregroundLayer)
{
var item = _libraryManager.GetStudio(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -1533,7 +1533,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageIndex)
{
var user = _userManager.GetUserById(userId);
- if (user?.ProfileImage == null)
+ if (user?.ProfileImage is null)
{
return NotFound();
}
@@ -1634,7 +1634,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? foregroundLayer)
{
var user = _userManager.GetUserById(userId);
- if (user?.ProfileImage == null)
+ if (user?.ProfileImage is null)
{
return NotFound();
}
@@ -1944,10 +1944,10 @@ namespace Jellyfin.Api.Controllers
unplayedCount = null;
}
- if (imageInfo == null)
+ if (imageInfo is null)
{
imageInfo = item?.GetImageInfo(imageType, imageIndex ?? 0);
- if (imageInfo == null)
+ if (imageInfo is null)
{
return NotFound(string.Format(NumberFormatInfo.InvariantInfo, "{0} does not have an image of type {1}", item?.Name, imageType));
}
diff --git a/Jellyfin.Api/Controllers/ItemLookupController.cs b/Jellyfin.Api/Controllers/ItemLookupController.cs
index c49f85616..34893d682 100644
--- a/Jellyfin.Api/Controllers/ItemLookupController.cs
+++ b/Jellyfin.Api/Controllers/ItemLookupController.cs
@@ -65,7 +65,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult<IEnumerable<ExternalIdInfo>> GetExternalIdInfos([FromRoute, Required] Guid itemId)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/ItemRefreshController.cs b/Jellyfin.Api/Controllers/ItemRefreshController.cs
index 9340737b5..0dc3fbd05 100644
--- a/Jellyfin.Api/Controllers/ItemRefreshController.cs
+++ b/Jellyfin.Api/Controllers/ItemRefreshController.cs
@@ -61,7 +61,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool replaceAllImages = false)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/ItemUpdateController.cs b/Jellyfin.Api/Controllers/ItemUpdateController.cs
index fd137f98f..5f992f033 100644
--- a/Jellyfin.Api/Controllers/ItemUpdateController.cs
+++ b/Jellyfin.Api/Controllers/ItemUpdateController.cs
@@ -71,7 +71,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult> UpdateItem([FromRoute, Required] Guid itemId, [FromBody, Required] BaseItemDto request)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -198,7 +198,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult UpdateItemContentType([FromRoute, Required] Guid itemId, [FromQuery] string? contentType)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs
index 7d5cfc7ae..80d1c008b 100644
--- a/Jellyfin.Api/Controllers/LibraryController.cs
+++ b/Jellyfin.Api/Controllers/LibraryController.cs
@@ -104,7 +104,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult GetFile([FromRoute, Required] Guid itemId)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -154,7 +154,7 @@ namespace Jellyfin.Api.Controllers
: _libraryManager.GetUserRootFolder())
: _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound("Item not found.");
}
@@ -171,7 +171,7 @@ namespace Jellyfin.Api.Controllers
}
var parent = item.GetParent();
- if (parent == null)
+ if (parent is null)
{
break;
}
@@ -220,7 +220,7 @@ namespace Jellyfin.Api.Controllers
: _libraryManager.GetUserRootFolder())
: _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound("Item not found.");
}
@@ -237,7 +237,7 @@ namespace Jellyfin.Api.Controllers
}
var parent = item.GetParent();
- if (parent == null)
+ if (parent is null)
{
break;
}
@@ -435,7 +435,7 @@ namespace Jellyfin.Api.Controllers
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound("Item not found");
}
@@ -610,7 +610,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult> GetDownload([FromRoute, Required] Guid itemId)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs
index 394df0f58..94710d78f 100644
--- a/Jellyfin.Api/Controllers/LiveTvController.cs
+++ b/Jellyfin.Api/Controllers/LiveTvController.cs
@@ -763,7 +763,7 @@ namespace Jellyfin.Api.Controllers
await AssertUserCanManageLiveTv().ConfigureAwait(false);
var item = _libraryManager.GetItemById(recordingId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -840,7 +840,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult<SeriesTimerInfoDto>> GetSeriesTimer([FromRoute, Required] string timerId)
{
var timer = await _liveTvManager.GetSeriesTimer(timerId, CancellationToken.None).ConfigureAwait(false);
- if (timer == null)
+ if (timer is null)
{
return NotFound();
}
@@ -1201,7 +1201,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult GetLiveStreamFile([FromRoute, Required] string streamId, [FromRoute, Required] string container)
{
var liveStreamInfo = _mediaSourceManager.GetLiveStreamInfoByUniqueId(streamId);
- if (liveStreamInfo == null)
+ if (liveStreamInfo is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/MediaInfoController.cs b/Jellyfin.Api/Controllers/MediaInfoController.cs
index c111e9218..be6453af9 100644
--- a/Jellyfin.Api/Controllers/MediaInfoController.cs
+++ b/Jellyfin.Api/Controllers/MediaInfoController.cs
@@ -121,7 +121,7 @@ namespace Jellyfin.Api.Controllers
var profile = playbackInfoDto?.DeviceProfile;
_logger.LogDebug("GetPostedPlaybackInfo profile: {@Profile}", profile);
- if (profile == null)
+ if (profile is null)
{
var caps = _deviceManager.GetCapabilities(User.GetDeviceId());
if (caps != null)
diff --git a/Jellyfin.Api/Controllers/PackageController.cs b/Jellyfin.Api/Controllers/PackageController.cs
index 9690aead0..0aa7c2ac9 100644
--- a/Jellyfin.Api/Controllers/PackageController.cs
+++ b/Jellyfin.Api/Controllers/PackageController.cs
@@ -54,7 +54,7 @@ namespace Jellyfin.Api.Controllers
assemblyGuid ?? default)
.FirstOrDefault();
- if (result == null)
+ if (result is null)
{
return NotFound();
}
@@ -110,7 +110,7 @@ namespace Jellyfin.Api.Controllers
specificVersion: string.IsNullOrEmpty(version) ? null : Version.Parse(version))
.FirstOrDefault();
- if (package == null)
+ if (package is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/PersonsController.cs b/Jellyfin.Api/Controllers/PersonsController.cs
index 42be969b2..09f7281ec 100644
--- a/Jellyfin.Api/Controllers/PersonsController.cs
+++ b/Jellyfin.Api/Controllers/PersonsController.cs
@@ -122,7 +122,7 @@ namespace Jellyfin.Api.Controllers
.AddClientFields(User);
var item = _libraryManager.GetPerson(name);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/PlaylistsController.cs b/Jellyfin.Api/Controllers/PlaylistsController.cs
index fb045f891..e0c565da1 100644
--- a/Jellyfin.Api/Controllers/PlaylistsController.cs
+++ b/Jellyfin.Api/Controllers/PlaylistsController.cs
@@ -176,7 +176,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes)
{
var playlist = (Playlist)_libraryManager.GetItemById(playlistId);
- if (playlist == null)
+ if (playlist is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/PlaystateController.cs b/Jellyfin.Api/Controllers/PlaystateController.cs
index 3a2ba033e..58f9b7d35 100644
--- a/Jellyfin.Api/Controllers/PlaystateController.cs
+++ b/Jellyfin.Api/Controllers/PlaystateController.cs
@@ -353,7 +353,7 @@ namespace Jellyfin.Api.Controllers
if (method == PlayMethod.Transcode)
{
var job = string.IsNullOrWhiteSpace(playSessionId) ? null : _transcodingJobHelper.GetTranscodingJob(playSessionId);
- if (job == null)
+ if (job is null)
{
return PlayMethod.DirectPlay;
}
diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.cs
index b227dba2d..361828fbd 100644
--- a/Jellyfin.Api/Controllers/PluginsController.cs
+++ b/Jellyfin.Api/Controllers/PluginsController.cs
@@ -71,7 +71,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult EnablePlugin([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version)
{
var plugin = _pluginManager.GetPlugin(pluginId, version);
- if (plugin == null)
+ if (plugin is null)
{
return NotFound();
}
@@ -95,7 +95,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult DisablePlugin([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version)
{
var plugin = _pluginManager.GetPlugin(pluginId, version);
- if (plugin == null)
+ if (plugin is null)
{
return NotFound();
}
@@ -119,7 +119,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult UninstallPluginByVersion([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version)
{
var plugin = _pluginManager.GetPlugin(pluginId, version);
- if (plugin == null)
+ if (plugin is null)
{
return NotFound();
}
@@ -146,7 +146,7 @@ namespace Jellyfin.Api.Controllers
var plugins = _pluginManager.Plugins.Where(p => p.Id.Equals(pluginId));
// Select the un-instanced one first.
- var plugin = plugins.FirstOrDefault(p => p.Instance == null) ?? plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault();
+ var plugin = plugins.FirstOrDefault(p => p.Instance is null) ?? plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault();
if (plugin != null)
{
@@ -225,13 +225,13 @@ namespace Jellyfin.Api.Controllers
public ActionResult GetPluginImage([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version)
{
var plugin = _pluginManager.GetPlugin(pluginId, version);
- if (plugin == null)
+ if (plugin is null)
{
return NotFound();
}
var imagePath = Path.Combine(plugin.Path, plugin.Manifest.ImagePath ?? string.Empty);
- if (plugin.Manifest.ImagePath == null || !System.IO.File.Exists(imagePath))
+ if (plugin.Manifest.ImagePath is null || !System.IO.File.Exists(imagePath))
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/RemoteImageController.cs b/Jellyfin.Api/Controllers/RemoteImageController.cs
index dbee56e14..da9e8cf90 100644
--- a/Jellyfin.Api/Controllers/RemoteImageController.cs
+++ b/Jellyfin.Api/Controllers/RemoteImageController.cs
@@ -68,7 +68,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool includeAllLanguages = false)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -127,7 +127,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult<IEnumerable<ImageProviderInfo>> GetRemoteImageProviders([FromRoute, Required] Guid itemId)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
@@ -154,7 +154,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? imageUrl)
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/ScheduledTasksController.cs b/Jellyfin.Api/Controllers/ScheduledTasksController.cs
index 68e4f0586..832e14505 100644
--- a/Jellyfin.Api/Controllers/ScheduledTasksController.cs
+++ b/Jellyfin.Api/Controllers/ScheduledTasksController.cs
@@ -76,7 +76,7 @@ namespace Jellyfin.Api.Controllers
var task = _taskManager.ScheduledTasks.FirstOrDefault(i =>
string.Equals(i.Id, taskId, StringComparison.OrdinalIgnoreCase));
- if (task == null)
+ if (task is null)
{
return NotFound();
}
@@ -99,7 +99,7 @@ namespace Jellyfin.Api.Controllers
var task = _taskManager.ScheduledTasks.FirstOrDefault(o =>
o.Id.Equals(taskId, StringComparison.OrdinalIgnoreCase));
- if (task == null)
+ if (task is null)
{
return NotFound();
}
@@ -123,7 +123,7 @@ namespace Jellyfin.Api.Controllers
var task = _taskManager.ScheduledTasks.FirstOrDefault(o =>
o.Id.Equals(taskId, StringComparison.OrdinalIgnoreCase));
- if (task == null)
+ if (task is null)
{
return NotFound();
}
@@ -149,7 +149,7 @@ namespace Jellyfin.Api.Controllers
{
var task = _taskManager.ScheduledTasks.FirstOrDefault(o =>
o.Id.Equals(taskId, StringComparison.OrdinalIgnoreCase));
- if (task == null)
+ if (task is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/SearchController.cs b/Jellyfin.Api/Controllers/SearchController.cs
index aeed0c0d6..3c0603a19 100644
--- a/Jellyfin.Api/Controllers/SearchController.cs
+++ b/Jellyfin.Api/Controllers/SearchController.cs
@@ -221,7 +221,7 @@ namespace Jellyfin.Api.Controllers
{
var itemWithImage = item.HasImage(ImageType.Thumb) ? item : null;
- if (itemWithImage == null && item is Episode)
+ if (itemWithImage is null && item is Episode)
{
itemWithImage = GetParentWithImage<Series>(item, ImageType.Thumb);
}
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs
index 31b95162d..9218c3b5c 100644
--- a/Jellyfin.Api/Controllers/SessionController.cs
+++ b/Jellyfin.Api/Controllers/SessionController.cs
@@ -294,7 +294,7 @@ namespace Jellyfin.Api.Controllers
{
var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
- if (command == null)
+ if (command is null)
{
throw new ArgumentException("Request body may not be null");
}
diff --git a/Jellyfin.Api/Controllers/SubtitleController.cs b/Jellyfin.Api/Controllers/SubtitleController.cs
index 1258a9876..b9c2a8ad8 100644
--- a/Jellyfin.Api/Controllers/SubtitleController.cs
+++ b/Jellyfin.Api/Controllers/SubtitleController.cs
@@ -96,7 +96,7 @@ namespace Jellyfin.Api.Controllers
{
var item = _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/TvShowsController.cs b/Jellyfin.Api/Controllers/TvShowsController.cs
index ea13ceb91..7f4f4d077 100644
--- a/Jellyfin.Api/Controllers/TvShowsController.cs
+++ b/Jellyfin.Api/Controllers/TvShowsController.cs
@@ -247,7 +247,7 @@ namespace Jellyfin.Api.Controllers
.GetSeasons(user, dtoOptions)
.FirstOrDefault(i => i.IndexNumber == season.Value);
- episodes = seasonItem == null ?
+ episodes = seasonItem is null ?
new List<BaseItem>()
: ((Season)seasonItem).GetEpisodes(user, dtoOptions);
}
diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.cs
index ff653fe6b..4ee3361b5 100644
--- a/Jellyfin.Api/Controllers/UserController.cs
+++ b/Jellyfin.Api/Controllers/UserController.cs
@@ -124,7 +124,7 @@ namespace Jellyfin.Api.Controllers
{
var user = _userManager.GetUserById(userId);
- if (user == null)
+ if (user is null)
{
return NotFound("User not found");
}
@@ -173,7 +173,7 @@ namespace Jellyfin.Api.Controllers
{
var user = _userManager.GetUserById(userId);
- if (user == null)
+ if (user is null)
{
return NotFound("User not found");
}
@@ -272,7 +272,7 @@ namespace Jellyfin.Api.Controllers
var user = _userManager.GetUserById(userId);
- if (user == null)
+ if (user is null)
{
return NotFound("User not found");
}
@@ -292,7 +292,7 @@ namespace Jellyfin.Api.Controllers
HttpContext.GetNormalizedRemoteIp().ToString(),
false).ConfigureAwait(false);
- if (success == null)
+ if (success is null)
{
return StatusCode(StatusCodes.Status403Forbidden, "Invalid user or password entered.");
}
@@ -333,7 +333,7 @@ namespace Jellyfin.Api.Controllers
var user = _userManager.GetUserById(userId);
- if (user == null)
+ if (user is null)
{
return NotFound("User not found");
}
@@ -544,7 +544,7 @@ namespace Jellyfin.Api.Controllers
}
var user = _userManager.GetUserById(userId);
- if (user == null)
+ if (user is null)
{
return BadRequest();
}
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs
index 8a2d5a27d..60e190616 100644
--- a/Jellyfin.Api/Controllers/UserLibraryController.cs
+++ b/Jellyfin.Api/Controllers/UserLibraryController.cs
@@ -402,7 +402,7 @@ namespace Jellyfin.Api.Controllers
{
var user = _userManager.GetUserById(userId);
- if (user == null)
+ if (user is null)
{
return NotFound();
}
@@ -411,7 +411,7 @@ namespace Jellyfin.Api.Controllers
? _libraryManager.GetUserRootFolder()
: _libraryManager.GetItemById(itemId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/UserViewsController.cs b/Jellyfin.Api/Controllers/UserViewsController.cs
index 85d154cac..3aeb444df 100644
--- a/Jellyfin.Api/Controllers/UserViewsController.cs
+++ b/Jellyfin.Api/Controllers/UserViewsController.cs
@@ -117,7 +117,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult<IEnumerable<SpecialViewOptionDto>> GetGroupingOptions([FromRoute, Required] Guid userId)
{
var user = _userManager.GetUserById(userId);
- if (user == null)
+ if (user is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/VideoAttachmentsController.cs b/Jellyfin.Api/Controllers/VideoAttachmentsController.cs
index c2bb0dfff..bb3162614 100644
--- a/Jellyfin.Api/Controllers/VideoAttachmentsController.cs
+++ b/Jellyfin.Api/Controllers/VideoAttachmentsController.cs
@@ -55,7 +55,7 @@ namespace Jellyfin.Api.Controllers
try
{
var item = _libraryManager.GetItemById(videoId);
- if (item == null)
+ if (item is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/VideosController.cs b/Jellyfin.Api/Controllers/VideosController.cs
index bf08ad376..17e556730 100644
--- a/Jellyfin.Api/Controllers/VideosController.cs
+++ b/Jellyfin.Api/Controllers/VideosController.cs
@@ -149,7 +149,7 @@ namespace Jellyfin.Api.Controllers
{
var video = (Video)_libraryManager.GetItemById(itemId);
- if (video == null)
+ if (video is null)
{
return NotFound("The video either does not exist or the id does not belong to a video.");
}
@@ -199,7 +199,7 @@ namespace Jellyfin.Api.Controllers
}
var primaryVersion = items.FirstOrDefault(i => i.MediaSourceCount > 1 && string.IsNullOrEmpty(i.PrimaryVersionId));
- if (primaryVersion == null)
+ if (primaryVersion is null)
{
primaryVersion = items
.OrderBy(i =>
@@ -444,7 +444,7 @@ namespace Jellyfin.Api.Controllers
StreamingHelpers.AddDlnaHeaders(state, Response.Headers, true, state.Request.StartTimeTicks, Request, _dlnaManager);
var liveStreamInfo = _mediaSourceManager.GetLiveStreamInfo(streamingRequest.LiveStreamId);
- if (liveStreamInfo == null)
+ if (liveStreamInfo is null)
{
return NotFound();
}
diff --git a/Jellyfin.Api/Controllers/YearsController.cs b/Jellyfin.Api/Controllers/YearsController.cs
index b732bdff3..f8193f19a 100644
--- a/Jellyfin.Api/Controllers/YearsController.cs
+++ b/Jellyfin.Api/Controllers/YearsController.cs
@@ -173,7 +173,7 @@ namespace Jellyfin.Api.Controllers
public ActionResult<BaseItemDto> GetYear([FromRoute, Required] int year, [FromQuery] Guid? userId)
{
var item = _libraryManager.GetYear(year);
- if (item == null)
+ if (item is null)
{
return NotFound();
}