update search
This commit is contained in:
parent
e429b42146
commit
4e90d73203
|
@ -763,21 +763,24 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
protected IEnumerable<BaseItem> GetCachedChildren()
|
||||
{
|
||||
var childrenItems = ItemRepository.GetChildrenItems(Id).Select(RetrieveChild).Where(i => i != null);
|
||||
if (ConfigurationManager.Configuration.DisableStartupScan)
|
||||
{
|
||||
return ItemRepository.GetChildrenItems(Id).Select(RetrieveChild).Where(i => i != null);
|
||||
//return ItemRepository.GetItems(new InternalItemsQuery
|
||||
//{
|
||||
// ParentId = Id
|
||||
|
||||
//var children = ItemRepository.GetChildren(Id).Select(RetrieveChild).Where(i => i != null).ToList();
|
||||
|
||||
//if (children.Count != childrenItems.Count)
|
||||
//{
|
||||
// var b = this;
|
||||
//}
|
||||
|
||||
return childrenItems;
|
||||
//}).Items.Select(RetrieveChild).Where(i => i != null);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ItemRepository.GetChildrenItems(Id).Select(RetrieveChild).Where(i => i != null);
|
||||
}
|
||||
}
|
||||
|
||||
private BaseItem RetrieveChild(BaseItem child)
|
||||
{
|
||||
if (child.Id == Guid.Empty)
|
||||
if (child == null || child.Id == Guid.Empty)
|
||||
{
|
||||
Logger.Error("Item found with empty Id: " + (child.Path ?? child.Name));
|
||||
return null;
|
||||
|
|
|
@ -101,6 +101,8 @@ namespace MediaBrowser.Controller.Entities
|
|||
public bool? IsOffline { get; set; }
|
||||
public LocationType? LocationType { get; set; }
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
public InternalItemsQuery()
|
||||
{
|
||||
Tags = new string[] { };
|
||||
|
|
|
@ -354,6 +354,10 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
return;
|
||||
}
|
||||
}
|
||||
//if (!(item is Folder))
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
LibraryItemsCache.AddOrUpdate(id, item, delegate { return item; });
|
||||
}
|
||||
|
||||
|
|
|
@ -1202,6 +1202,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
whereClauses.Add(string.Format("ChannelId in ({0})", inClause));
|
||||
}
|
||||
|
||||
if (query.ParentId.HasValue)
|
||||
{
|
||||
whereClauses.Add("ParentId=@ParentId");
|
||||
cmd.Parameters.Add(cmd, "@ParentId", DbType.Guid).Value = query.ParentId.Value;
|
||||
}
|
||||
|
||||
if (query.MinEndDate.HasValue)
|
||||
{
|
||||
whereClauses.Add("EndDate>=@MinEndDate");
|
||||
|
|
|
@ -309,6 +309,9 @@
|
|||
<Content Include="dashboard-ui\scripts\searchmenu.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\searchpage.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\secondaryitems.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
@ -330,6 +333,9 @@
|
|||
<Content Include="dashboard-ui\scripts\wizardlivetvtuner.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\search.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\secondaryitems.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in New Issue
Block a user