Remove more and more warnings
This commit is contained in:
@@ -154,11 +154,11 @@ namespace Jellyfin.Api.Controllers
|
||||
};
|
||||
|
||||
if (!item.IsVirtualItem
|
||||
&& !(item is ICollectionFolder)
|
||||
&& !(item is UserView)
|
||||
&& !(item is AggregateFolder)
|
||||
&& !(item is LiveTvChannel)
|
||||
&& !(item is IItemByName)
|
||||
&& item is not ICollectionFolder
|
||||
&& item is not UserView
|
||||
&& item is not AggregateFolder
|
||||
&& item is not LiveTvChannel
|
||||
&& item is not IItemByName
|
||||
&& item.SourceType == SourceType.Library)
|
||||
{
|
||||
var inheritedContentType = _libraryManager.GetInheritedContentType(item);
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Jellyfin.Api.Controllers
|
||||
var item = _libraryManager.GetParentItem(parentId, userId);
|
||||
QueryResult<BaseItem> result;
|
||||
|
||||
if (!(item is Folder folder))
|
||||
if (item is not Folder folder)
|
||||
{
|
||||
folder = _libraryManager.GetUserRootFolder();
|
||||
}
|
||||
@@ -285,7 +285,7 @@ namespace Jellyfin.Api.Controllers
|
||||
return Unauthorized($"{user.Username} is not permitted to access Library {item.Name}.");
|
||||
}
|
||||
|
||||
if ((recursive.HasValue && recursive.Value) || ids.Length != 0 || !(item is UserRootFolder))
|
||||
if ((recursive.HasValue && recursive.Value) || ids.Length != 0 || item is not UserRootFolder)
|
||||
{
|
||||
var query = new InternalItemsQuery(user!)
|
||||
{
|
||||
|
||||
@@ -700,7 +700,7 @@ namespace Jellyfin.Api.Controllers
|
||||
: _libraryManager.RootFolder)
|
||||
: _libraryManager.GetItemById(itemId);
|
||||
|
||||
if (item is Episode || (item is IItemByName && !(item is MusicArtist)))
|
||||
if (item is Episode || (item is IItemByName && item is not MusicArtist))
|
||||
{
|
||||
return new QueryResult<BaseItemDto>();
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace Jellyfin.Api.Controllers
|
||||
if (seasonId.HasValue) // Season id was supplied. Get episodes by season id.
|
||||
{
|
||||
var item = _libraryManager.GetItemById(seasonId.Value);
|
||||
if (!(item is Season seasonItem))
|
||||
if (item is not Season seasonItem)
|
||||
{
|
||||
return NotFound("No season exists with Id " + seasonId);
|
||||
}
|
||||
@@ -237,7 +237,7 @@ namespace Jellyfin.Api.Controllers
|
||||
}
|
||||
else if (season.HasValue) // Season number was supplied. Get episodes by season number
|
||||
{
|
||||
if (!(_libraryManager.GetItemById(seriesId) is Series series))
|
||||
if (_libraryManager.GetItemById(seriesId) is not Series series)
|
||||
{
|
||||
return NotFound("Series not found");
|
||||
}
|
||||
@@ -252,7 +252,7 @@ namespace Jellyfin.Api.Controllers
|
||||
}
|
||||
else // No season number or season id was supplied. Returning all episodes.
|
||||
{
|
||||
if (!(_libraryManager.GetItemById(seriesId) is Series series))
|
||||
if (_libraryManager.GetItemById(seriesId) is not Series series)
|
||||
{
|
||||
return NotFound("Series not found");
|
||||
}
|
||||
@@ -336,7 +336,7 @@ namespace Jellyfin.Api.Controllers
|
||||
? _userManager.GetUserById(userId.Value)
|
||||
: null;
|
||||
|
||||
if (!(_libraryManager.GetItemById(seriesId) is Series series))
|
||||
if (_libraryManager.GetItemById(seriesId) is not Series series)
|
||||
{
|
||||
return NotFound("Series not found");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user