Genre.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using MediaBrowser.Controller.Entities.Audio;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. /// <summary>
  8. /// Class Genre
  9. /// </summary>
  10. public class Genre : BaseItem, IItemByName
  11. {
  12. /// <summary>
  13. /// Gets the user data key.
  14. /// </summary>
  15. /// <returns>System.String.</returns>
  16. public override string GetUserDataKey()
  17. {
  18. return "Genre-" + 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. public override string ContainingFolderPath
  26. {
  27. get
  28. {
  29. return Path;
  30. }
  31. }
  32. /// <summary>
  33. /// Gets a value indicating whether this instance is owned item.
  34. /// </summary>
  35. /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
  36. public override bool IsOwnedItem
  37. {
  38. get
  39. {
  40. return false;
  41. }
  42. }
  43. public IEnumerable<BaseItem> GetTaggedItems(IEnumerable<BaseItem> inputItems)
  44. {
  45. return inputItems.Where(i => !(i is Game) && !(i is IHasMusicGenres) && i.Genres.Contains(Name, StringComparer.OrdinalIgnoreCase));
  46. }
  47. }
  48. }