diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index f74a8bda7d..5d054c3b9d 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -183,7 +183,7 @@ namespace MediaBrowser.Controller.Entities { // Local trailer, special feature, theme video, etc. // An item that belongs to another item but is not part of the Parent-Child tree - return !IsFolder && Parent == null && LocationType == LocationType.FileSystem; + return !IsFolder && ParentId == Guid.Empty && LocationType == LocationType.FileSystem; } } diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index fe0e4890c2..4a846b4cee 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -283,17 +283,17 @@ namespace MediaBrowser.Providers.Manager { var options = GetMetadataOptions(item); - return GetMetadataProvidersInternal(item, options, false); + return GetMetadataProvidersInternal(item, options, false, true); } - private IEnumerable> GetMetadataProvidersInternal(IHasMetadata item, MetadataOptions options, bool includeDisabled) + private IEnumerable> GetMetadataProvidersInternal(IHasMetadata item, MetadataOptions options, bool includeDisabled, bool checkIsOwnedItem) where T : IHasMetadata { // Avoid implicitly captured closure var currentOptions = options; return _metadataProviders.OfType>() - .Where(i => CanRefresh(i, item, currentOptions, includeDisabled)) + .Where(i => CanRefresh(i, item, currentOptions, includeDisabled, checkIsOwnedItem)) .OrderBy(i => GetConfiguredOrder(i, options)) .ThenBy(GetDefaultOrder); } @@ -318,7 +318,7 @@ namespace MediaBrowser.Providers.Manager return GetImageProviders(item, options, includeDisabled).OfType(); } - private bool CanRefresh(IMetadataProvider provider, IHasMetadata item, MetadataOptions options, bool includeDisabled) + private bool CanRefresh(IMetadataProvider provider, IHasMetadata item, MetadataOptions options, bool includeDisabled, bool checkIsOwnedItem) { if (!includeDisabled) { @@ -348,7 +348,7 @@ namespace MediaBrowser.Providers.Manager } // If this restriction is ever lifted, movie xml providers will have to be updated to prevent owned items like trailers from reading those files - if (item.IsOwnedItem) + if (checkIsOwnedItem && item.IsOwnedItem) { if (provider is ILocalMetadataProvider || provider is IRemoteMetadataProvider) { @@ -491,7 +491,8 @@ namespace MediaBrowser.Providers.Manager // Give it a dummy path just so that it looks like a file system item var dummy = new T() { - Path = Path.Combine(_appPaths.InternalMetadataPath, "dummy") + Path = Path.Combine(_appPaths.InternalMetadataPath, "dummy"), + ParentId = Guid.NewGuid() }; dummy.SetParent(new Folder()); @@ -523,7 +524,7 @@ namespace MediaBrowser.Providers.Manager private void AddMetadataPlugins(List list, T item, MetadataOptions options) where T : IHasMetadata { - var providers = GetMetadataProvidersInternal(item, options, true).ToList(); + var providers = GetMetadataProvidersInternal(item, options, true, false).ToList(); // Locals list.AddRange(providers.Where(i => (i is ILocalMetadataProvider)).Select(i => new MetadataPlugin @@ -732,14 +733,15 @@ namespace MediaBrowser.Providers.Manager // Give it a dummy path just so that it looks like a file system item var dummy = new TItemType { - Path = Path.Combine(_appPaths.InternalMetadataPath, "dummy") + Path = Path.Combine(_appPaths.InternalMetadataPath, "dummy"), + ParentId = Guid.NewGuid() }; dummy.SetParent(new Folder()); var options = GetMetadataOptions(dummy); - var providers = GetMetadataProvidersInternal(dummy, options, searchInfo.IncludeDisabledProviders) + var providers = GetMetadataProvidersInternal(dummy, options, searchInfo.IncludeDisabledProviders, false) .OfType>(); if (!string.IsNullOrEmpty(searchInfo.SearchProviderName)) diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index f6811724f8..24450b1707 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -336,6 +336,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest