ItemsWithPersonHandler.cs 956 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using MediaBrowser.Controller;
  4. using MediaBrowser.Model.Entities;
  5. namespace MediaBrowser.Api.HttpHandlers
  6. {
  7. /// <summary>
  8. /// Gets all items within containing a person
  9. /// </summary>
  10. public class ItemsWithPersonHandler : ItemListHandler
  11. {
  12. protected override IEnumerable<BaseItem> ItemsToSerialize
  13. {
  14. get
  15. {
  16. Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
  17. PersonType? personType = null;
  18. string type = QueryString["persontype"];
  19. if (!string.IsNullOrEmpty(type))
  20. {
  21. personType = (PersonType)Enum.Parse(typeof(PersonType), type, true);
  22. }
  23. return Kernel.Instance.GetItemsWithPerson(parent, QueryString["name"], personType, UserId);
  24. }
  25. }
  26. }
  27. }