Use helper function to compare guid (#10825)

This commit is contained in:
Cody Robibero
2024-01-17 08:51:39 -07:00
committed by GitHub
parent 484ccf7f28
commit e7b8d45bbb
58 changed files with 249 additions and 184 deletions

View File

@@ -240,7 +240,7 @@ namespace MediaBrowser.Controller.Entities
{
get
{
if (!ChannelId.Equals(default))
if (!ChannelId.IsEmpty())
{
return SourceType.Channel;
}
@@ -530,7 +530,7 @@ namespace MediaBrowser.Controller.Entities
get
{
var id = DisplayParentId;
if (id.Equals(default))
if (id.IsEmpty())
{
return null;
}
@@ -746,7 +746,7 @@ namespace MediaBrowser.Controller.Entities
public virtual bool StopRefreshIfLocalMetadataFound => true;
[JsonIgnore]
protected virtual bool SupportsOwnedItems => !ParentId.Equals(default) && IsFileProtocol;
protected virtual bool SupportsOwnedItems => !ParentId.IsEmpty() && IsFileProtocol;
[JsonIgnore]
public virtual bool SupportsPeople => false;
@@ -823,7 +823,7 @@ namespace MediaBrowser.Controller.Entities
public BaseItem GetOwner()
{
var ownerId = OwnerId;
return ownerId.Equals(default) ? null : LibraryManager.GetItemById(ownerId);
return ownerId.IsEmpty() ? null : LibraryManager.GetItemById(ownerId);
}
public bool CanDelete(User user, List<Folder> allCollectionFolders)
@@ -968,7 +968,7 @@ namespace MediaBrowser.Controller.Entities
public BaseItem GetParent()
{
var parentId = ParentId;
if (parentId.Equals(default))
if (parentId.IsEmpty())
{
return null;
}
@@ -1361,7 +1361,7 @@ namespace MediaBrowser.Controller.Entities
var tasks = extras.Select(i =>
{
var subOptions = new MetadataRefreshOptions(options);
if (!i.OwnerId.Equals(ownerId) || !i.ParentId.Equals(default))
if (!i.OwnerId.Equals(ownerId) || !i.ParentId.IsEmpty())
{
i.OwnerId = ownerId;
i.ParentId = Guid.Empty;
@@ -1673,7 +1673,7 @@ namespace MediaBrowser.Controller.Entities
// First get using the cached Id
if (info.ItemId.HasValue)
{
if (info.ItemId.Value.Equals(default))
if (info.ItemId.Value.IsEmpty())
{
return null;
}
@@ -2439,7 +2439,7 @@ namespace MediaBrowser.Controller.Entities
return Task.FromResult(true);
}
if (video.OwnerId.Equals(default))
if (video.OwnerId.IsEmpty())
{
video.OwnerId = this.Id;
}