mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 06:48:35 +01:00
add query by PersonId
This commit is contained in:
@@ -41,6 +41,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public string NameLessThan { get; set; }
|
||||
|
||||
public string Person { get; set; }
|
||||
public string[] PersonIds { get; set; }
|
||||
public string AdjacentTo { get; set; }
|
||||
public string[] PersonTypes { get; set; }
|
||||
|
||||
@@ -87,6 +88,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
VideoTypes = new VideoType[] { };
|
||||
Years = new int[] { };
|
||||
PersonTypes = new string[] { };
|
||||
PersonIds = new string[] { };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
case CollectionType.Books:
|
||||
case CollectionType.Photos:
|
||||
case CollectionType.HomeVideos:
|
||||
case CollectionType.MusicVideos:
|
||||
return GetResult(queryParent.GetChildren(user, true), queryParent, query);
|
||||
|
||||
case CollectionType.Folders:
|
||||
@@ -1056,6 +1057,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
return false;
|
||||
}
|
||||
|
||||
if (request.PersonIds.Length > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (request.Studios.Length > 0)
|
||||
{
|
||||
return false;
|
||||
@@ -1632,7 +1638,13 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
// Apply person filter
|
||||
if (!string.IsNullOrEmpty(query.Person))
|
||||
if (query.PersonIds.Length > 0 && !(query.PersonIds.Any(v => item.People.Select(i => i.Name).Contains(v, StringComparer.OrdinalIgnoreCase))))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Apply person filter
|
||||
if (!string.IsNullOrWhiteSpace(query.Person))
|
||||
{
|
||||
var personTypes = query.PersonTypes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user