mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-25 06:58:40 +02:00
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))
|
if (filters.Contains(ItemFilter.IsFavorite))
|
||||||
{
|
{
|
||||||
items = items.Where(i =>
|
items = items.Where(i =>
|
||||||
|
|
|
@ -335,6 +335,22 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
{
|
{
|
||||||
switch (filter)
|
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:
|
case ItemFilter.Likes:
|
||||||
return items.Where(item =>
|
return items.Where(item =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,10 @@ namespace MediaBrowser.Model.Querying
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The dislikes
|
/// The dislikes
|
||||||
/// </summary>
|
/// </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
|
var people = RootFolder.RecursiveChildren
|
||||||
.Where(c => c.People != null)
|
.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)
|
.DistinctBy(p => p.Name, StringComparer.OrdinalIgnoreCase)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
|
|
@ -454,6 +454,7 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
"edititempeople.js",
|
"edititempeople.js",
|
||||||
"edititemimages.js",
|
"edititemimages.js",
|
||||||
"edituserpage.js",
|
"edituserpage.js",
|
||||||
|
"favoritetv.js",
|
||||||
"gamesrecommendedpage.js",
|
"gamesrecommendedpage.js",
|
||||||
"gamesystemspage.js",
|
"gamesystemspage.js",
|
||||||
"gamespage.js",
|
"gamespage.js",
|
||||||
|
|
|
@ -291,6 +291,9 @@
|
||||||
<Content Include="dashboard-ui\edititemmetadata.html">
|
<Content Include="dashboard-ui\edititemmetadata.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\favoritetv.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\gamegenres.html">
|
<Content Include="dashboard-ui\gamegenres.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -378,6 +381,9 @@
|
||||||
<Content Include="dashboard-ui\scripts\edititemmetadata.js">
|
<Content Include="dashboard-ui\scripts\edititemmetadata.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\scripts\favoritetv.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\scripts\itemgallery.js">
|
<Content Include="dashboard-ui\scripts\itemgallery.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
Loading…
Reference in a new issue