Studio.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. /// <summary>
  13. /// Gets the user data key.
  14. /// </summary>
  15. /// <returns>System.String.</returns>
  16. protected override string CreateUserDataKey()
  17. {
  18. return "Studio-" + Name;
  19. }
  20. /// <summary>
  21. /// Returns the folder containing the item.
  22. /// If the item is a folder, it returns the folder itself
  23. /// </summary>
  24. /// <value>The containing folder path.</value>
  25. [IgnoreDataMember]
  26. public override string ContainingFolderPath
  27. {
  28. get
  29. {
  30. return Path;
  31. }
  32. }
  33. public override bool CanDelete()
  34. {
  35. return false;
  36. }
  37. public override bool IsSaveLocalMetadataEnabled()
  38. {
  39. return true;
  40. }
  41. /// <summary>
  42. /// Gets a value indicating whether this instance is owned item.
  43. /// </summary>
  44. /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
  45. [IgnoreDataMember]
  46. public override bool IsOwnedItem
  47. {
  48. get
  49. {
  50. return false;
  51. }
  52. }
  53. public IEnumerable<BaseItem> GetTaggedItems(IEnumerable<BaseItem> inputItems)
  54. {
  55. return inputItems.Where(GetItemFilter());
  56. }
  57. public Func<BaseItem, bool> GetItemFilter()
  58. {
  59. return i => i.Studios.Contains(Name, StringComparer.OrdinalIgnoreCase);
  60. }
  61. [IgnoreDataMember]
  62. public override bool SupportsPeople
  63. {
  64. get
  65. {
  66. return false;
  67. }
  68. }
  69. }
  70. }