Studio.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Serialization;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. /// <summary>
  8. /// Class Studio
  9. /// </summary>
  10. public class Studio : BaseItem, IItemByName, IHasTags
  11. {
  12. public override List<string> GetUserDataKeys()
  13. {
  14. var list = base.GetUserDataKeys();
  15. list.Insert(0, "Studio-" + Name);
  16. return list;
  17. }
  18. /// <summary>
  19. /// Returns the folder containing the item.
  20. /// If the item is a folder, it returns the folder itself
  21. /// </summary>
  22. /// <value>The containing folder path.</value>
  23. [IgnoreDataMember]
  24. public override string ContainingFolderPath
  25. {
  26. get
  27. {
  28. return Path;
  29. }
  30. }
  31. public override bool CanDelete()
  32. {
  33. return false;
  34. }
  35. public override bool IsSaveLocalMetadataEnabled()
  36. {
  37. return true;
  38. }
  39. /// <summary>
  40. /// Gets a value indicating whether this instance is owned item.
  41. /// </summary>
  42. /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
  43. [IgnoreDataMember]
  44. public override bool IsOwnedItem
  45. {
  46. get
  47. {
  48. return false;
  49. }
  50. }
  51. public IEnumerable<BaseItem> GetTaggedItems(IEnumerable<BaseItem> inputItems)
  52. {
  53. return inputItems.Where(GetItemFilter());
  54. }
  55. public Func<BaseItem, bool> GetItemFilter()
  56. {
  57. return i => i.Studios.Contains(Name, StringComparer.OrdinalIgnoreCase);
  58. }
  59. [IgnoreDataMember]
  60. public override bool SupportsPeople
  61. {
  62. get
  63. {
  64. return false;
  65. }
  66. }
  67. }
  68. }