Replace != null with is not null

This commit is contained in:
Bond_009
2022-12-05 15:01:13 +01:00
parent c7d50d640e
commit 52194f56b5
218 changed files with 928 additions and 928 deletions

View File

@@ -483,7 +483,7 @@ namespace MediaBrowser.Controller.Entities
}
});
if (container != null)
if (container is not null)
{
await RefreshAllMetadataForContainer(container, refreshOptions, innerProgress, cancellationToken).ConfigureAwait(false);
}
@@ -515,7 +515,7 @@ namespace MediaBrowser.Controller.Entities
async () =>
{
var series = container as Series;
if (series != null)
if (series is not null)
{
await series.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
}
@@ -529,7 +529,7 @@ namespace MediaBrowser.Controller.Entities
{
var container = child as IMetadataContainer;
if (container != null)
if (container is not null)
{
await RefreshAllMetadataForContainer(container, refreshOptions, progress, cancellationToken).ConfigureAwait(false);
}
@@ -741,7 +741,7 @@ namespace MediaBrowser.Controller.Entities
IEnumerable<BaseItem> itemsList = LibraryManager.GetItemList(query);
var user = query.User;
if (user != null)
if (user is not null)
{
// needed for boxsets
itemsList = itemsList.Where(i => i.IsVisibleStandalone(query.User));
@@ -984,7 +984,7 @@ namespace MediaBrowser.Controller.Entities
var user = query.User;
// Check recursive - don't substitute in plain folder views
if (user != null)
if (user is not null)
{
items = CollapseBoxSetItemsIfNeeded(items, query, this, user, ConfigurationManager, CollectionManager);
}
@@ -1069,7 +1069,7 @@ namespace MediaBrowser.Controller.Entities
if (!param.HasValue)
{
if (user != null && !configurationManager.Configuration.EnableGroupingIntoCollections)
if (user is not null && !configurationManager.Configuration.EnableGroupingIntoCollections)
{
return false;
}
@@ -1441,7 +1441,7 @@ namespace MediaBrowser.Controller.Entities
{
var child = GetLinkedChild(i);
if (child != null)
if (child is not null)
{
list.Add(child);
}
@@ -1467,7 +1467,7 @@ namespace MediaBrowser.Controller.Entities
var child = GetLinkedChild(i);
if (child != null && child.Id.Equals(itemId))
if (child is not null && child.Id.Equals(itemId))
{
return true;
}
@@ -1547,7 +1547,7 @@ namespace MediaBrowser.Controller.Entities
{
return LinkedChildren
.Select(i => new Tuple<LinkedChild, BaseItem>(i, GetLinkedChild(i)))
.Where(i => i.Item2 != null);
.Where(i => i.Item2 is not null);
}
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, IReadOnlyList<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
@@ -1605,7 +1605,7 @@ namespace MediaBrowser.Controller.Entities
return null;
}
})
.Where(i => i != null)
.Where(i => i is not null)
.ToList();
var currentShortcutLinks = LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut).ToList();
@@ -1662,7 +1662,7 @@ namespace MediaBrowser.Controller.Entities
{
// The querying doesn't support virtual unaired
var episode = item as Episode;
if (episode != null && episode.IsUnaired)
if (episode is not null && episode.IsUnaired)
{
continue;
}
@@ -1719,7 +1719,7 @@ namespace MediaBrowser.Controller.Entities
return;
}
if (itemDto != null)
if (itemDto is not null)
{
if (fields.ContainsField(ItemFields.RecursiveItemCount))
{