Don't run series and movie resolvers against VF's

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti 2012-08-28 12:36:31 -04:00
parent a0d69b3804
commit 578ec7c5a5
4 changed files with 21 additions and 1 deletions

View File

@ -116,7 +116,7 @@ namespace MediaBrowser.Api
dto.SpecialCounts = folder.GetSpecialCounts(user);
dto.IsRoot = folder.IsRoot;
dto.IsVirtualFolder = folder.Parent != null && folder.Parent.IsRoot;
dto.IsVirtualFolder = folder.IsVirtualFolder;
}
Audio audio = item as Audio;

View File

@ -16,6 +16,14 @@ namespace MediaBrowser.Model.Entities
public bool IsRoot { get; set; }
public bool IsVirtualFolder
{
get
{
return Parent != null && Parent.IsRoot;
}
}
public IEnumerable<BaseItem> Children { get; set; }
/// <summary>

View File

@ -24,6 +24,12 @@ namespace MediaBrowser.Movies.Resolvers
}
}
// Optimization to avoid running all these tests against VF's
if (args.Parent != null && args.Parent.IsVirtualFolder)
{
return null;
}
// Return a movie if the video resolver finds something in the folder
return GetMovie(args);
}

View File

@ -15,6 +15,12 @@ namespace MediaBrowser.TV.Resolvers
{
if (args.IsDirectory)
{
// Optimization to avoid running all these tests against VF's
if (args.Parent != null && args.Parent.IsVirtualFolder)
{
return null;
}
// Optimization to avoid running these tests against Seasons
if (args.Parent is Series)
{