Code Clean up: Use Pattern Matching (#5838)

Co-authored-by: Cody Robibero <cody@robibe.ro>
Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
This commit is contained in:
BaronGreenback
2021-05-05 12:37:36 +01:00
committed by GitHub
parent 18d799b22a
commit f2c10471bf
16 changed files with 23 additions and 63 deletions

View File

@@ -281,8 +281,7 @@ namespace MediaBrowser.Providers.Manager
return true;
}
var folder = item as Folder;
if (folder != null)
if (item is Folder folder)
{
return folder.SupportsDateLastMediaAdded || folder.SupportsCumulativeRunTimeTicks;
}
@@ -336,8 +335,7 @@ namespace MediaBrowser.Providers.Manager
private ItemUpdateType UpdateCumulativeRunTimeTicks(TItemType item, IList<BaseItem> children)
{
var folder = item as Folder;
if (folder != null && folder.SupportsCumulativeRunTimeTicks)
if (item is Folder folder && folder.SupportsCumulativeRunTimeTicks)
{
long ticks = 0;