fix auto organize

pull/702/head
Luke Pulverenti 9 years ago
parent 04aa4965c6
commit b7af1213a4

@ -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;
}
}

@ -283,17 +283,17 @@ namespace MediaBrowser.Providers.Manager
{
var options = GetMetadataOptions(item);
return GetMetadataProvidersInternal<T>(item, options, false);
return GetMetadataProvidersInternal<T>(item, options, false, true);
}
private IEnumerable<IMetadataProvider<T>> GetMetadataProvidersInternal<T>(IHasMetadata item, MetadataOptions options, bool includeDisabled)
private IEnumerable<IMetadataProvider<T>> GetMetadataProvidersInternal<T>(IHasMetadata item, MetadataOptions options, bool includeDisabled, bool checkIsOwnedItem)
where T : IHasMetadata
{
// Avoid implicitly captured closure
var currentOptions = options;
return _metadataProviders.OfType<IMetadataProvider<T>>()
.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<IRemoteImageProvider>();
}
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<T>(List<MetadataPlugin> list, T item, MetadataOptions options)
where T : IHasMetadata
{
var providers = GetMetadataProvidersInternal<T>(item, options, true).ToList();
var providers = GetMetadataProvidersInternal<T>(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<TItemType>(dummy, options, searchInfo.IncludeDisabledProviders)
var providers = GetMetadataProvidersInternal<TItemType>(dummy, options, searchInfo.IncludeDisabledProviders, false)
.OfType<IRemoteSearchProvider<TLookupType>>();
if (!string.IsNullOrEmpty(searchInfo.SearchProviderName))

@ -336,6 +336,12 @@
<Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jqm.collapsible.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jqm.controlgroup.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jqm.controlgroup.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jqm.listview.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

Loading…
Cancel
Save