GameGenre.cs 1.3 KB

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