added studio and people placeholder pages
This commit is contained in:
parent
e3f7dcac19
commit
c3e3b68bb2
|
@ -68,7 +68,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
|
|
||||||
var ibnItemsArray = GetAllItems(request, items, user).ToArray();
|
var ibnItemsArray = GetAllItems(request, items, user).ToArray();
|
||||||
|
|
||||||
IEnumerable<Tuple<string, Func<int>>> ibnItems = ibnItemsArray;
|
IEnumerable<Tuple<string, Func<IEnumerable<BaseItem>>>> ibnItems = ibnItemsArray;
|
||||||
|
|
||||||
var result = new ItemsResult
|
var result = new ItemsResult
|
||||||
{
|
{
|
||||||
|
@ -132,7 +132,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <param name="items">The items.</param>
|
/// <param name="items">The items.</param>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
||||||
protected abstract IEnumerable<Tuple<string, Func<int>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user);
|
protected abstract IEnumerable<Tuple<string, Func<IEnumerable<BaseItem>>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the entity.
|
/// Gets the entity.
|
||||||
|
@ -148,7 +148,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <param name="fields">The fields.</param>
|
/// <param name="fields">The fields.</param>
|
||||||
/// <returns>Task{DtoBaseItem}.</returns>
|
/// <returns>Task{DtoBaseItem}.</returns>
|
||||||
private async Task<BaseItemDto> GetDto(Tuple<string, Func<int>> stub, User user, List<ItemFields> fields)
|
private async Task<BaseItemDto> GetDto(Tuple<string, Func<IEnumerable<BaseItem>>> stub, User user, List<ItemFields> fields)
|
||||||
{
|
{
|
||||||
BaseItem item;
|
BaseItem item;
|
||||||
|
|
||||||
|
@ -164,7 +164,13 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
|
|
||||||
var dto = await new DtoBuilder(Logger, LibraryManager, UserManager).GetBaseItemDto(item, user, fields).ConfigureAwait(false);
|
var dto = await new DtoBuilder(Logger, LibraryManager, UserManager).GetBaseItemDto(item, user, fields).ConfigureAwait(false);
|
||||||
|
|
||||||
dto.ChildCount = stub.Item2();
|
if (fields.Contains(ItemFields.ItemCounts))
|
||||||
|
{
|
||||||
|
var items = stub.Item2().ToList();
|
||||||
|
|
||||||
|
dto.ChildCount = items.Count;
|
||||||
|
dto.RecentlyAddedItemCount = items.Count(i => i.IsRecentlyAdded(user));
|
||||||
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,14 +47,14 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <param name="items">The items.</param>
|
/// <param name="items">The items.</param>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
||||||
protected override IEnumerable<Tuple<string, Func<int>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
protected override IEnumerable<Tuple<string, Func<IEnumerable<BaseItem>>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
||||||
{
|
{
|
||||||
var itemsList = items.Where(i => i.Genres != null).ToList();
|
var itemsList = items.Where(i => i.Genres != null).ToList();
|
||||||
|
|
||||||
return itemsList
|
return itemsList
|
||||||
.SelectMany(i => i.Genres)
|
.SelectMany(i => i.Genres)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
.Select(name => new Tuple<string, Func<int>>(name, () => itemsList.Count(i => i.Genres.Contains(name, StringComparer.OrdinalIgnoreCase))));
|
.Select(name => new Tuple<string, Func<IEnumerable<BaseItem>>>(name, () => itemsList.Where(i => i.Genres.Contains(name, StringComparer.OrdinalIgnoreCase))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <param name="items">The items.</param>
|
/// <param name="items">The items.</param>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
||||||
protected override IEnumerable<Tuple<string, Func<int>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
protected override IEnumerable<Tuple<string, Func<IEnumerable<BaseItem>>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
||||||
{
|
{
|
||||||
var inputPersonTypes = ((GetPersons) request).PersonTypes;
|
var inputPersonTypes = ((GetPersons) request).PersonTypes;
|
||||||
var personTypes = string.IsNullOrEmpty(inputPersonTypes) ? new string[] { } : inputPersonTypes.Split(',');
|
var personTypes = string.IsNullOrEmpty(inputPersonTypes) ? new string[] { } : inputPersonTypes.Split(',');
|
||||||
|
@ -66,14 +66,14 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
.Select(i => i.Name)
|
.Select(i => i.Name)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
|
||||||
.Select(name => new Tuple<string, Func<int>>(name, () =>
|
.Select(name => new Tuple<string, Func<IEnumerable<BaseItem>>>(name, () =>
|
||||||
{
|
{
|
||||||
if (personTypes.Length == 0)
|
if (personTypes.Length == 0)
|
||||||
{
|
{
|
||||||
return itemsList.Count(i => i.People.Any(p => p.Name.Equals(name, StringComparison.OrdinalIgnoreCase)));
|
return itemsList.Where(i => i.People.Any(p => p.Name.Equals(name, StringComparison.OrdinalIgnoreCase)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemsList.Count(i => i.People.Any(p => p.Name.Equals(name, StringComparison.OrdinalIgnoreCase) && personTypes.Contains(p.Type ?? string.Empty, StringComparer.OrdinalIgnoreCase)));
|
return itemsList.Where(i => i.People.Any(p => p.Name.Equals(name, StringComparison.OrdinalIgnoreCase) && personTypes.Contains(p.Type ?? string.Empty, StringComparer.OrdinalIgnoreCase)));
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,14 +47,14 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <param name="items">The items.</param>
|
/// <param name="items">The items.</param>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
||||||
protected override IEnumerable<Tuple<string, Func<int>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
protected override IEnumerable<Tuple<string, Func<IEnumerable<BaseItem>>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
||||||
{
|
{
|
||||||
var itemsList = items.Where(i => i.Studios != null).ToList();
|
var itemsList = items.Where(i => i.Studios != null).ToList();
|
||||||
|
|
||||||
return itemsList
|
return itemsList
|
||||||
.SelectMany(i => i.Studios)
|
.SelectMany(i => i.Studios)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
.Select(name => new Tuple<string, Func<int>>(name, () => itemsList.Count(i => i.Studios.Contains(name, StringComparer.OrdinalIgnoreCase))));
|
.Select(name => new Tuple<string, Func<IEnumerable<BaseItem>>>(name, () => itemsList.Where(i => i.Studios.Contains(name, StringComparer.OrdinalIgnoreCase))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -53,14 +53,14 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <param name="items">The items.</param>
|
/// <param name="items">The items.</param>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
||||||
protected override IEnumerable<Tuple<string, Func<int>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
protected override IEnumerable<Tuple<string, Func<IEnumerable<BaseItem>>>> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items, User user)
|
||||||
{
|
{
|
||||||
var itemsList = items.Where(i => i.ProductionYear != null).ToList();
|
var itemsList = items.Where(i => i.ProductionYear != null).ToList();
|
||||||
|
|
||||||
return itemsList
|
return itemsList
|
||||||
.Select(i => i.ProductionYear.Value)
|
.Select(i => i.ProductionYear.Value)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.Select(year => new Tuple<string, Func<int>>(year.ToString(UsCulture), () => itemsList.Count(i => i.ProductionYear.HasValue && i.ProductionYear.Value == year)));
|
.Select(year => new Tuple<string, Func<IEnumerable<BaseItem>>>(year.ToString(UsCulture), () => itemsList.Where(i => i.ProductionYear.HasValue && i.ProductionYear.Value == year)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -463,7 +463,9 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
"metadataimagespage.js",
|
"metadataimagespage.js",
|
||||||
"moviegenres.js",
|
"moviegenres.js",
|
||||||
"movies.js",
|
"movies.js",
|
||||||
|
"moviepeople.js",
|
||||||
"moviesrecommended.js",
|
"moviesrecommended.js",
|
||||||
|
"moviestudios.js",
|
||||||
"playlist.js",
|
"playlist.js",
|
||||||
"pluginspage.js",
|
"pluginspage.js",
|
||||||
"pluginupdatespage.js",
|
"pluginupdatespage.js",
|
||||||
|
@ -475,6 +477,7 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
"tvseries.js",
|
"tvseries.js",
|
||||||
"tvrecommended.js",
|
"tvrecommended.js",
|
||||||
"tvshows.js",
|
"tvshows.js",
|
||||||
|
"tvstudios.js",
|
||||||
"updatepasswordpage.js",
|
"updatepasswordpage.js",
|
||||||
"userimagepage.js",
|
"userimagepage.js",
|
||||||
"userprofilespage.js",
|
"userprofilespage.js",
|
||||||
|
|
|
@ -204,9 +204,15 @@
|
||||||
<Content Include="dashboard-ui\movies.html">
|
<Content Include="dashboard-ui\movies.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\moviepeople.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\moviesrecommended.html">
|
<Content Include="dashboard-ui\moviesrecommended.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\moviestudios.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\musicrecommended.html">
|
<Content Include="dashboard-ui\musicrecommended.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -225,6 +231,12 @@
|
||||||
<Content Include="dashboard-ui\scripts\moviegenres.js">
|
<Content Include="dashboard-ui\scripts\moviegenres.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\scripts\moviepeople.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\scripts\moviestudios.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\scripts\playlist.js">
|
<Content Include="dashboard-ui\scripts\playlist.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -272,6 +284,9 @@
|
||||||
<Content Include="dashboard-ui\scripts\tvshows.js">
|
<Content Include="dashboard-ui\scripts\tvshows.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\scripts\tvstudios.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\scripts\videojsextensions.js">
|
<Content Include="dashboard-ui\scripts\videojsextensions.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -296,6 +311,9 @@
|
||||||
<Content Include="dashboard-ui\tvshows.html">
|
<Content Include="dashboard-ui\tvshows.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\tvstudios.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\userprofiles.html">
|
<Content Include="dashboard-ui\userprofiles.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user