aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs23
-rw-r--r--MediaBrowser.Controller/Entities/InternalItemsQuery.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs4
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs6
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj6
5 files changed, 31 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 04d42e16f..3b00d50be 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -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);
-
- //var children = ItemRepository.GetChildren(Id).Select(RetrieveChild).Where(i => i != null).ToList();
-
- //if (children.Count != childrenItems.Count)
- //{
- // var b = this;
- //}
+ if (ConfigurationManager.Configuration.DisableStartupScan)
+ {
+ return ItemRepository.GetChildrenItems(Id).Select(RetrieveChild).Where(i => i != null);
+ //return ItemRepository.GetItems(new InternalItemsQuery
+ //{
+ // ParentId = Id
- 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;
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
index bde4d0f45..e2d9d9a58 100644
--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
@@ -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[] { };
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 966c1e037..0be871b0e 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -354,6 +354,10 @@ namespace MediaBrowser.Server.Implementations.Library
return;
}
}
+ //if (!(item is Folder))
+ //{
+ // return;
+ //}
LibraryItemsCache.AddOrUpdate(id, item, delegate { return item; });
}
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index adadea894..ce1a91791 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -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");
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 57e52a254..3a2f0c7e1 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -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>