Keep folder extras with the item that owns the folder
This commit is contained in:
@@ -771,6 +771,17 @@ namespace MediaBrowser.Controller.Entities
|
||||
[JsonIgnore]
|
||||
protected virtual bool SupportsOwnedItems => !ParentId.IsEmpty() && IsFileProtocol;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this item searches the folder it lives in for its own extras.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
protected virtual bool SearchesContainingFolderForExtras =>
|
||||
IsFileProtocol
|
||||
&& SupportsOwnedItems
|
||||
&& !IsInMixedFolder
|
||||
&& this is not (ICollectionFolder or UserRootFolder or AggregateFolder)
|
||||
&& GetType() != typeof(Folder);
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual bool SupportsPeople => false;
|
||||
|
||||
@@ -1528,7 +1539,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns><c>true</c> if any items have changed, else <c>false</c>.</returns>
|
||||
protected virtual async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, IReadOnlyList<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!IsFileProtocol || !SupportsOwnedItems || IsInMixedFolder || this is ICollectionFolder or UserRootFolder or AggregateFolder || this.GetType() == typeof(Folder))
|
||||
if (!SearchesContainingFolderForExtras)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetParent() is Folder container
|
||||
&& container.SearchesContainingFolderForExtras
|
||||
&& string.Equals(container.Path, ContainingFolderPath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user