Studio.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace MediaBrowser.Controller.Entities
  5. {
  6. /// <summary>
  7. /// Class Studio
  8. /// </summary>
  9. public class Studio : BaseItem, IItemByName, IHasTags
  10. {
  11. public List<string> Tags { get; set; }
  12. public Studio()
  13. {
  14. Tags = new List<string>();
  15. }
  16. /// <summary>
  17. /// Gets the user data key.
  18. /// </summary>
  19. /// <returns>System.String.</returns>
  20. public override string GetUserDataKey()
  21. {
  22. return "Studio-" + Name;
  23. }
  24. /// <summary>
  25. /// Returns the folder containing the item.
  26. /// If the item is a folder, it returns the folder itself
  27. /// </summary>
  28. /// <value>The containing folder path.</value>
  29. public override string ContainingFolderPath
  30. {
  31. get
  32. {
  33. return Path;
  34. }
  35. }
  36. /// <summary>
  37. /// Gets a value indicating whether this instance is owned item.
  38. /// </summary>
  39. /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
  40. public override bool IsOwnedItem
  41. {
  42. get
  43. {
  44. return false;
  45. }
  46. }
  47. public IEnumerable<BaseItem> GetTaggedItems(IEnumerable<BaseItem> inputItems)
  48. {
  49. return inputItems.Where(i => i.Studios.Contains(Name, StringComparer.OrdinalIgnoreCase));
  50. }
  51. }
  52. }