mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
Code Clean up: Convert to null-coalescing operator ?? (#5845)
Co-authored-by: Cody Robibero <cody@robibe.ro> Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
This commit is contained in:
@@ -176,10 +176,7 @@ namespace Emby.Server.Implementations.Library
|
||||
{
|
||||
lock (_rootFolderSyncLock)
|
||||
{
|
||||
if (_rootFolder == null)
|
||||
{
|
||||
_rootFolder = CreateRootFolder();
|
||||
}
|
||||
_rootFolder ??= CreateRootFolder();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,14 +35,10 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
||||
return null;
|
||||
}
|
||||
|
||||
var season = parent as Season;
|
||||
|
||||
// Just in case the user decided to nest episodes.
|
||||
// Not officially supported but in some cases we can handle it.
|
||||
if (season == null)
|
||||
{
|
||||
season = parent.GetParents().OfType<Season>().FirstOrDefault();
|
||||
}
|
||||
|
||||
var season = parent as Season ?? parent.GetParents().OfType<Season>().FirstOrDefault();
|
||||
|
||||
// If the parent is a Season or Series and the parent is not an extras folder, then this is an Episode if the VideoResolver returns something
|
||||
// Also handle flat tv folders
|
||||
@@ -55,11 +51,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
||||
|
||||
if (episode != null)
|
||||
{
|
||||
var series = parent as Series;
|
||||
if (series == null)
|
||||
{
|
||||
series = parent.GetParents().OfType<Series>().FirstOrDefault();
|
||||
}
|
||||
var series = parent as Series ?? parent.GetParents().OfType<Series>().FirstOrDefault();
|
||||
|
||||
if (series != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user