aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/BaseItem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs36
1 files changed, 18 insertions, 18 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 7f5f9f74b..20f009588 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -494,7 +494,7 @@ namespace MediaBrowser.Controller.Entities
{
get
{
- if (_sortName == null)
+ if (_sortName is null)
{
if (!string.IsNullOrEmpty(ForcedSortName))
{
@@ -880,7 +880,7 @@ namespace MediaBrowser.Controller.Entities
/// <returns>System.String.</returns>
protected virtual string CreateSortName()
{
- if (Name == null)
+ if (Name is null)
{
return null; // some items may not have name filled in properly
}
@@ -1073,7 +1073,7 @@ namespace MediaBrowser.Controller.Entities
{
var stream = i.VideoStream;
- return stream == null || stream.Width == null ? 0 : stream.Width.Value;
+ return stream is null || stream.Width is null ? 0 : stream.Width.Value;
})
.ToList();
}
@@ -1330,7 +1330,7 @@ namespace MediaBrowser.Controller.Entities
public void SetParent(Folder parent)
{
- ParentId = parent == null ? Guid.Empty : parent.Id;
+ ParentId = parent is null ? Guid.Empty : parent.Id;
}
/// <summary>
@@ -1534,7 +1534,7 @@ namespace MediaBrowser.Controller.Entities
var maxAllowedRating = user.MaxParentalAgeRating;
- if (maxAllowedRating == null)
+ if (maxAllowedRating is null)
{
return true;
}
@@ -1701,7 +1701,7 @@ namespace MediaBrowser.Controller.Entities
var item = FindLinkedChild(info);
// If still null, log
- if (item == null)
+ if (item is null)
{
// Don't keep searching over and over
info.ItemId = Guid.Empty;
@@ -1725,7 +1725,7 @@ namespace MediaBrowser.Controller.Entities
var itemByPath = LibraryManager.FindByPath(path, null);
- if (itemByPath == null)
+ if (itemByPath is null)
{
Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
}
@@ -1737,7 +1737,7 @@ namespace MediaBrowser.Controller.Entities
{
var item = LibraryManager.GetItemById(info.LibraryItemId);
- if (item == null)
+ if (item is null)
{
Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
}
@@ -1892,7 +1892,7 @@ namespace MediaBrowser.Controller.Entities
var existingImage = GetImageInfo(image.Type, index);
- if (existingImage == null)
+ if (existingImage is null)
{
AddImage(image);
}
@@ -1915,7 +1915,7 @@ namespace MediaBrowser.Controller.Entities
var image = GetImageInfo(type, index);
- if (image == null)
+ if (image is null)
{
AddImage(GetImageInfo(file, type));
}
@@ -1942,7 +1942,7 @@ namespace MediaBrowser.Controller.Entities
{
var info = GetImageInfo(type, index);
- if (info == null)
+ if (info is null)
{
// Nothing to do
return;
@@ -2035,7 +2035,7 @@ namespace MediaBrowser.Controller.Entities
{
var chapter = ItemRepository.GetChapter(this, imageIndex);
- if (chapter == null)
+ if (chapter is null)
{
return null;
}
@@ -2147,7 +2147,7 @@ namespace MediaBrowser.Controller.Entities
foreach (var newImage in images)
{
- if (newImage == null)
+ if (newImage is null)
{
throw new ArgumentException("null image found in list");
}
@@ -2155,7 +2155,7 @@ namespace MediaBrowser.Controller.Entities
var existing = existingImages
.Find(i => string.Equals(i.Path, newImage.FullName, StringComparison.OrdinalIgnoreCase));
- if (existing == null)
+ if (existing is null)
{
newImageList.Add(newImage);
}
@@ -2241,7 +2241,7 @@ namespace MediaBrowser.Controller.Entities
var info1 = GetImageInfo(type, index1);
var info2 = GetImageInfo(type, index2);
- if (info1 == null || info2 == null)
+ if (info1 is null || info2 is null)
{
// Nothing to do
return Task.CompletedTask;
@@ -2290,7 +2290,7 @@ namespace MediaBrowser.Controller.Entities
var userdata = UserDataManager.GetUserData(user, this);
- return userdata == null || !userdata.Played;
+ return userdata is null || !userdata.Played;
}
ItemLookupInfo IHasLookupInfo<ItemLookupInfo>.GetLookupInfo()
@@ -2445,14 +2445,14 @@ namespace MediaBrowser.Controller.Entities
// Try to retrieve it from the db. If we don't find it, use the resolved version
var video = LibraryManager.GetItemById(id) as Video;
- if (video == null)
+ if (video is null)
{
video = LibraryManager.ResolvePath(FileSystem.GetFileSystemInfo(path)) as Video;
newOptions.ForceSave = true;
}
- if (video == null)
+ if (video is null)
{
return Task.FromResult(true);
}