mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-01 11:23:36 +02:00
Allow video extras to use owner library options
This commit is contained in:
parent
a2babfd0d3
commit
e4040ab812
|
@ -1999,38 +1999,35 @@ namespace Emby.Server.Implementations.Library
|
||||||
|
|
||||||
public List<Folder> GetCollectionFolders(BaseItem item)
|
public List<Folder> GetCollectionFolders(BaseItem item)
|
||||||
{
|
{
|
||||||
while (item is not null)
|
return GetCollectionFolders(item, GetUserRootFolder().Children.OfType<Folder>());
|
||||||
{
|
|
||||||
var parent = item.GetParent();
|
|
||||||
|
|
||||||
if (parent is null || parent is AggregateFolder)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
item = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item is null)
|
|
||||||
{
|
|
||||||
return new List<Folder>();
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetCollectionFoldersInternal(item, GetUserRootFolder().Children.OfType<Folder>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Folder> GetCollectionFolders(BaseItem item, List<Folder> allUserRootChildren)
|
public List<Folder> GetCollectionFolders(BaseItem item, IEnumerable<Folder> allUserRootChildren)
|
||||||
{
|
{
|
||||||
while (item is not null)
|
while (item is not null)
|
||||||
{
|
{
|
||||||
var parent = item.GetParent();
|
var parent = item.GetParent();
|
||||||
|
|
||||||
if (parent is null || parent is AggregateFolder)
|
if (parent is AggregateFolder)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
item = parent;
|
if (parent is null)
|
||||||
|
{
|
||||||
|
var owner = item.GetOwner();
|
||||||
|
|
||||||
|
if (owner is null)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
item = owner;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = parent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item is null)
|
if (item is null)
|
||||||
|
|
|
@ -2451,6 +2451,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return Task.FromResult(true);
|
return Task.FromResult(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (video.OwnerId.Equals(default))
|
||||||
|
{
|
||||||
|
video.OwnerId = this.Id;
|
||||||
|
}
|
||||||
|
|
||||||
return RefreshMetadataForOwnedItem(video, copyTitleMetadata, newOptions, cancellationToken);
|
return RefreshMetadataForOwnedItem(video, copyTitleMetadata, newOptions, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -429,10 +429,16 @@ namespace MediaBrowser.Controller.Library
|
||||||
/// Gets the collection folders.
|
/// Gets the collection folders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns>IEnumerable<Folder>.</returns>
|
/// <returns>The folders that contain the item.</returns>
|
||||||
List<Folder> GetCollectionFolders(BaseItem item);
|
List<Folder> GetCollectionFolders(BaseItem item);
|
||||||
|
|
||||||
List<Folder> GetCollectionFolders(BaseItem item, List<Folder> allUserRootChildren);
|
/// <summary>
|
||||||
|
/// Gets the collection folders.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">The item.</param>
|
||||||
|
/// <param name="allUserRootChildren">The root folders to consider.</param>
|
||||||
|
/// <returns>The folders that contain the item.</returns>
|
||||||
|
List<Folder> GetCollectionFolders(BaseItem item, IEnumerable<Folder> allUserRootChildren);
|
||||||
|
|
||||||
LibraryOptions GetLibraryOptions(BaseItem item);
|
LibraryOptions GetLibraryOptions(BaseItem item);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue