Cleaner type checking

This commit is contained in:
crobibero 2020-12-02 07:55:34 -07:00
parent 41e127d1d2
commit 08be7f094a

View File

@ -92,12 +92,12 @@ namespace Jellyfin.Api.Controllers
}
};
var itemList = ((Folder?)item)?.GetItemList(query);
if (itemList == null)
if (!(item is Folder folder))
{
return new QueryFiltersLegacy();
}
var itemList = folder.GetItemList(query);
return new QueryFiltersLegacy
{
Years = itemList.Select(i => i.ProductionYear ?? -1)