MetadataResult.cs 898 B

1234567891011121314151617181920212223242526272829303132333435
  1. using MediaBrowser.Controller.Entities;
  2. using System.Collections.Generic;
  3. namespace MediaBrowser.Controller.Providers
  4. {
  5. public class MetadataResult<T>
  6. {
  7. public List<PersonInfo> People { get; set; }
  8. public bool HasMetadata { get; set; }
  9. public T Item { get; set; }
  10. public void AddPerson(PersonInfo p)
  11. {
  12. if (People == null)
  13. {
  14. People = new List<PersonInfo>();
  15. }
  16. PeopleHelper.AddPerson(People, p);
  17. }
  18. /// <summary>
  19. /// Not only does this clear, but initializes the list so that services can differentiate between a null list and zero people
  20. /// </summary>
  21. public void ResetPeople()
  22. {
  23. if (People == null)
  24. {
  25. People = new List<PersonInfo>();
  26. }
  27. People.Clear();
  28. }
  29. }
  30. }