GameSystem.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System.Runtime.Serialization;
  2. using MediaBrowser.Controller.Providers;
  3. using MediaBrowser.Model.Configuration;
  4. using System;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. /// <summary>
  8. /// Class GameSystem
  9. /// </summary>
  10. public class GameSystem : Folder, IHasLookupInfo<GameSystemInfo>
  11. {
  12. /// <summary>
  13. /// Return the id that should be used to key display prefs for this item.
  14. /// Default is based on the type for everything except actual generic folders.
  15. /// </summary>
  16. /// <value>The display prefs id.</value>
  17. [IgnoreDataMember]
  18. public override Guid DisplayPreferencesId
  19. {
  20. get
  21. {
  22. return Id;
  23. }
  24. }
  25. /// <summary>
  26. /// Gets or sets the game system.
  27. /// </summary>
  28. /// <value>The game system.</value>
  29. public string GameSystemName { get; set; }
  30. /// <summary>
  31. /// Gets the user data key.
  32. /// </summary>
  33. /// <returns>System.String.</returns>
  34. public override string GetUserDataKey()
  35. {
  36. if (!string.IsNullOrEmpty(GameSystemName))
  37. {
  38. return "GameSystem-" + GameSystemName;
  39. }
  40. return base.GetUserDataKey();
  41. }
  42. protected override bool GetBlockUnratedValue(UserConfiguration config)
  43. {
  44. // Don't block. Determine by game
  45. return false;
  46. }
  47. public GameSystemInfo GetLookupInfo()
  48. {
  49. var id = GetItemLookupInfo<GameSystemInfo>();
  50. id.Path = Path;
  51. return id;
  52. }
  53. }
  54. }