Added GetItemsWithPerson

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-08-14 15:06:25 -04:00
parent ee1fa6e816
commit 0788f435c1
6 changed files with 83 additions and 5 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using MediaBrowser.Controller;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
/// <summary>
/// Gets all items within containing a person
/// </summary>
public class ItemsWithPersonHandler : ItemListHandler
{
protected override IEnumerable<BaseItem> ItemsToSerialize
{
get
{
Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
PersonType? personType = null;
string type = QueryString["persontype"];
if (!string.IsNullOrEmpty(type))
{
personType = (PersonType)Enum.Parse(typeof(PersonType), type, true);
}
return Kernel.Instance.GetItemsWithPerson(parent, QueryString["name"], personType, UserId);
}
}
}
}