added favorites page to the tv section
This commit is contained in:
parent
d5bfdd7988
commit
d977ba932b
|
@ -169,6 +169,24 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
});
|
||||
}
|
||||
|
||||
if (filters.Contains(ItemFilter.IsFavoriteOrLikes))
|
||||
{
|
||||
items = items.Where(i =>
|
||||
{
|
||||
var userdata = i.GetUserItemData(UserDataRepository, user.Id).Result;
|
||||
|
||||
if (userdata == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var likes = userdata.Likes ?? false;
|
||||
var favorite = userdata.IsFavorite;
|
||||
|
||||
return likes || favorite;
|
||||
});
|
||||
}
|
||||
|
||||
if (filters.Contains(ItemFilter.IsFavorite))
|
||||
{
|
||||
items = items.Where(i =>
|
||||
|
|
|
@ -335,6 +335,22 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
{
|
||||
switch (filter)
|
||||
{
|
||||
case ItemFilter.IsFavoriteOrLikes:
|
||||
return items.Where(item =>
|
||||
{
|
||||
var userdata = repository.GetUserData(user.Id, item.GetUserDataKey());
|
||||
|
||||
if (userdata == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var likes = userdata.Likes ?? false;
|
||||
var favorite = userdata.IsFavorite;
|
||||
|
||||
return likes || favorite;
|
||||
});
|
||||
|
||||
case ItemFilter.Likes:
|
||||
return items.Where(item =>
|
||||
{
|
||||
|
|
|
@ -41,6 +41,10 @@ namespace MediaBrowser.Model.Querying
|
|||
/// <summary>
|
||||
/// The dislikes
|
||||
/// </summary>
|
||||
Dislikes = 9
|
||||
Dislikes = 9,
|
||||
/// <summary>
|
||||
/// The is favorite or likes
|
||||
/// </summary>
|
||||
IsFavoriteOrLikes = 10,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -850,7 +850,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
|
||||
var people = RootFolder.RecursiveChildren
|
||||
.Where(c => c.People != null)
|
||||
.SelectMany(c => c.People.Where(p => includedPersonTypes.Contains(p.Type)))
|
||||
.SelectMany(c => c.People.Where(p => includedPersonTypes.Contains(p.Type, StringComparer.OrdinalIgnoreCase) || includedPersonTypes.Contains(p.Role, StringComparer.OrdinalIgnoreCase)))
|
||||
.DistinctBy(p => p.Name, StringComparer.OrdinalIgnoreCase)
|
||||
.ToList();
|
||||
|
||||
|
|
|
@ -454,6 +454,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
"edititempeople.js",
|
||||
"edititemimages.js",
|
||||
"edituserpage.js",
|
||||
"favoritetv.js",
|
||||
"gamesrecommendedpage.js",
|
||||
"gamesystemspage.js",
|
||||
"gamespage.js",
|
||||
|
|
|
@ -291,6 +291,9 @@
|
|||
<Content Include="dashboard-ui\edititemmetadata.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\favoritetv.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\gamegenres.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
@ -378,6 +381,9 @@
|
|||
<Content Include="dashboard-ui\scripts\edititemmetadata.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\favoritetv.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\itemgallery.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in New Issue
Block a user