Initial support of shortcuts everywhere

This commit is contained in:
Eric Reed 2013-08-19 17:17:03 -04:00
parent eec92175f9
commit 80fb3c9eb4
4 changed files with 45 additions and 9 deletions

View File

@ -11,6 +11,17 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
public class AggregateFolder : Folder
{
/// <summary>
/// We don't support manual shortcuts
/// </summary>
protected override bool SupportsShortcutChildren
{
get
{
return false;
}
}
/// <summary>
/// The _virtual children
/// </summary>

View File

@ -67,6 +67,38 @@ namespace MediaBrowser.Controller.Entities
return NullTaskResult;
}
/// <summary>
/// Our children are actually just references to the ones in the physical root...
/// </summary>
/// <value>The linked children.</value>
public override List<LinkedChild> LinkedChildren
{
get
{
ItemResolveArgs resolveArgs;
try
{
resolveArgs = ResolveArgs;
}
catch (IOException ex)
{
Logger.ErrorException("Error getting ResolveArgs for {0}", ex, Path);
return new List<LinkedChild>();
}
return LibraryManager.RootFolder.RecursiveChildren
.OfType<Folder>()
.Where(i => i.Path != null && resolveArgs.PhysicalLocations.Contains(i.Path, StringComparer.OrdinalIgnoreCase))
.SelectMany(c => c.LinkedChildren).ToList();
}
set
{
base.LinkedChildren = value;
}
}
/// <summary>
/// Our children are actually just references to the ones in the physical root...
/// </summary>

View File

@ -81,11 +81,11 @@ namespace MediaBrowser.Controller.Entities
}
}
public List<LinkedChild> LinkedChildren { get; set; }
public virtual List<LinkedChild> LinkedChildren { get; set; }
protected virtual bool SupportsShortcutChildren
{
get { return false; }
get { return true; }
}
/// <summary>

View File

@ -6,12 +6,5 @@ namespace MediaBrowser.Controller.Entities.Movies
/// </summary>
public class BoxSet : Folder
{
protected override bool SupportsShortcutChildren
{
get
{
return true;
}
}
}
}