Prefer null checks over HasValue everywhere

This commit is contained in:
Shadowghost
2026-07-22 08:09:33 +02:00
parent 733b4ba73a
commit 6382563440
16 changed files with 21 additions and 21 deletions
@@ -1114,7 +1114,7 @@ namespace MediaBrowser.Providers.Manager
target.PremiereDate = source.PremiereDate;
}
if (replaceData || !target.ProductionYear.HasValue)
if (replaceData || target.ProductionYear is null)
{
target.ProductionYear = source.ProductionYear;
}
@@ -432,9 +432,9 @@ namespace MediaBrowser.Providers.MediaInfo
}
}
if (data.ProductionYear.HasValue)
if (data.ProductionYear is not null)
{
if (!video.ProductionYear.HasValue || replaceData)
if (video.ProductionYear is null || replaceData)
{
video.ProductionYear = data.ProductionYear;
}
@@ -482,7 +482,7 @@ namespace MediaBrowser.Providers.MediaInfo
}
// If we don't have a ProductionYear try and get it from PremiereDate
if (video.PremiereDate.HasValue && !video.ProductionYear.HasValue)
if (video.PremiereDate is not null && video.ProductionYear is null)
{
video.ProductionYear = video.PremiereDate.Value.ToLocalTime().Year;
}