2
0

GameSystem.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using MediaBrowser.Model.Serialization;
  2. using MediaBrowser.Controller.Providers;
  3. using MediaBrowser.Model.Configuration;
  4. using System;
  5. using System.Collections.Generic;
  6. using MediaBrowser.Model.Users;
  7. namespace MediaBrowser.Controller.Entities
  8. {
  9. /// <summary>
  10. /// Class GameSystem
  11. /// </summary>
  12. public class GameSystem : Folder, IHasLookupInfo<GameSystemInfo>
  13. {
  14. /// <summary>
  15. /// Return the id that should be used to key display prefs for this item.
  16. /// Default is based on the type for everything except actual generic folders.
  17. /// </summary>
  18. /// <value>The display prefs id.</value>
  19. [IgnoreDataMember]
  20. public override Guid DisplayPreferencesId
  21. {
  22. get
  23. {
  24. return Id;
  25. }
  26. }
  27. [IgnoreDataMember]
  28. public override bool SupportsPlayedStatus
  29. {
  30. get
  31. {
  32. return false;
  33. }
  34. }
  35. [IgnoreDataMember]
  36. public override bool SupportsInheritedParentImages
  37. {
  38. get
  39. {
  40. return false;
  41. }
  42. }
  43. public override double GetDefaultPrimaryImageAspectRatio()
  44. {
  45. double value = 16;
  46. value /= 9;
  47. return value;
  48. }
  49. /// <summary>
  50. /// Gets or sets the game system.
  51. /// </summary>
  52. /// <value>The game system.</value>
  53. public string GameSystemName { get; set; }
  54. public override List<string> GetUserDataKeys()
  55. {
  56. var list = base.GetUserDataKeys();
  57. if (!string.IsNullOrEmpty(GameSystemName))
  58. {
  59. list.Insert(0, "GameSystem-" + GameSystemName);
  60. }
  61. return list;
  62. }
  63. protected override bool GetBlockUnratedValue(UserPolicy config)
  64. {
  65. // Don't block. Determine by game
  66. return false;
  67. }
  68. public override UnratedItem GetBlockUnratedType()
  69. {
  70. return UnratedItem.Game;
  71. }
  72. public GameSystemInfo GetLookupInfo()
  73. {
  74. var id = GetItemLookupInfo<GameSystemInfo>();
  75. id.Path = Path;
  76. return id;
  77. }
  78. [IgnoreDataMember]
  79. public override bool SupportsPeople
  80. {
  81. get
  82. {
  83. return false;
  84. }
  85. }
  86. }
  87. }