Merge pull request #7767 from 1337joe/prefer-embedded-extras-titles

pull/8895/head
Bond-009 2 years ago committed by GitHub
commit 8d8d0ee911
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1998,40 +1998,37 @@ namespace Emby.Server.Implementations.Library
} }
public List<Folder> GetCollectionFolders(BaseItem item) public List<Folder> GetCollectionFolders(BaseItem item)
{
return GetCollectionFolders(item, GetUserRootFolder().Children.OfType<Folder>());
}
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)
}
if (item is null)
{
return new List<Folder>();
}
return GetCollectionFoldersInternal(item, GetUserRootFolder().Children.OfType<Folder>());
}
public List<Folder> GetCollectionFolders(BaseItem item, List<Folder> allUserRootChildren)
{ {
while (item is not null) var owner = item.GetOwner();
{
var parent = item.GetParent();
if (parent is null || parent is AggregateFolder) if (owner is null)
{ {
break; break;
} }
item = owner;
}
else
{
item = parent; 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&lt;Folder&gt;.</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);

@ -45,6 +45,8 @@ namespace MediaBrowser.Model.Configuration
public bool EnableEmbeddedTitles { get; set; } public bool EnableEmbeddedTitles { get; set; }
public bool EnableEmbeddedExtrasTitles { get; set; }
public bool EnableEmbeddedEpisodeInfos { get; set; } public bool EnableEmbeddedEpisodeInfos { get; set; }
public int AutomaticRefreshIntervalDays { get; set; } public int AutomaticRefreshIntervalDays { get; set; }

@ -484,8 +484,8 @@ namespace MediaBrowser.Providers.MediaInfo
{ {
if (!string.IsNullOrWhiteSpace(data.Name) && libraryOptions.EnableEmbeddedTitles) if (!string.IsNullOrWhiteSpace(data.Name) && libraryOptions.EnableEmbeddedTitles)
{ {
// Don't use the embedded name for extras because it will often be the same name as the movie // Separate option to use the embedded name for extras because it will often be the same name as the movie
if (!video.ExtraType.HasValue) if (!video.ExtraType.HasValue || libraryOptions.EnableEmbeddedExtrasTitles)
{ {
video.Name = data.Name; video.Name = data.Name;
} }

Loading…
Cancel
Save