Game.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using MediaBrowser.Model.Configuration;
  2. using MediaBrowser.Model.Entities;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. public class Game : BaseItem, IHasSoundtracks, IHasTrailers, IHasThemeMedia, IHasTags, IHasScreenshots, IHasPreferredMetadataLanguage
  8. {
  9. public List<Guid> SoundtrackIds { get; set; }
  10. public List<Guid> ThemeSongIds { get; set; }
  11. public List<Guid> ThemeVideoIds { get; set; }
  12. public string PreferredMetadataLanguage { get; set; }
  13. /// <summary>
  14. /// Gets or sets the preferred metadata country code.
  15. /// </summary>
  16. /// <value>The preferred metadata country code.</value>
  17. public string PreferredMetadataCountryCode { get; set; }
  18. public Game()
  19. {
  20. MultiPartGameFiles = new List<string>();
  21. SoundtrackIds = new List<Guid>();
  22. RemoteTrailers = new List<MediaUrl>();
  23. LocalTrailerIds = new List<Guid>();
  24. ThemeSongIds = new List<Guid>();
  25. ThemeVideoIds = new List<Guid>();
  26. Tags = new List<string>();
  27. ScreenshotImagePaths = new List<string>();
  28. }
  29. public List<Guid> LocalTrailerIds { get; set; }
  30. /// <summary>
  31. /// Gets or sets the screenshot image paths.
  32. /// </summary>
  33. /// <value>The screenshot image paths.</value>
  34. public List<string> ScreenshotImagePaths { get; set; }
  35. /// <summary>
  36. /// Gets or sets the tags.
  37. /// </summary>
  38. /// <value>The tags.</value>
  39. public List<string> Tags { get; set; }
  40. /// <summary>
  41. /// Gets or sets the remote trailers.
  42. /// </summary>
  43. /// <value>The remote trailers.</value>
  44. public List<MediaUrl> RemoteTrailers { get; set; }
  45. /// <summary>
  46. /// Gets the type of the media.
  47. /// </summary>
  48. /// <value>The type of the media.</value>
  49. public override string MediaType
  50. {
  51. get { return Model.Entities.MediaType.Game; }
  52. }
  53. /// <summary>
  54. /// Gets or sets the players supported.
  55. /// </summary>
  56. /// <value>The players supported.</value>
  57. public int? PlayersSupported { get; set; }
  58. /// <summary>
  59. /// Gets or sets a value indicating whether this instance is installed on client.
  60. /// </summary>
  61. /// <value><c>true</c> if this instance is installed on client; otherwise, <c>false</c>.</value>
  62. public bool IsInstalledOnClient { get; set; }
  63. /// <summary>
  64. /// Gets or sets the game system.
  65. /// </summary>
  66. /// <value>The game system.</value>
  67. public string GameSystem { get; set; }
  68. /// <summary>
  69. /// Gets or sets a value indicating whether this instance is multi part.
  70. /// </summary>
  71. /// <value><c>true</c> if this instance is multi part; otherwise, <c>false</c>.</value>
  72. public bool IsMultiPart { get; set; }
  73. /// <summary>
  74. /// Holds the paths to the game files in the event this is a multipart game
  75. /// </summary>
  76. public List<string> MultiPartGameFiles { get; set; }
  77. public override string GetUserDataKey()
  78. {
  79. var id = this.GetProviderId(MetadataProviders.Gamesdb);
  80. if (!string.IsNullOrEmpty(id))
  81. {
  82. return "Game-Gamesdb-" + id;
  83. }
  84. return base.GetUserDataKey();
  85. }
  86. public override IEnumerable<string> GetDeletePaths()
  87. {
  88. if (!IsInMixedFolder)
  89. {
  90. return new[] { System.IO.Path.GetDirectoryName(Path) };
  91. }
  92. return base.GetDeletePaths();
  93. }
  94. protected override bool GetBlockUnratedValue(UserConfiguration config)
  95. {
  96. return config.BlockUnratedGames;
  97. }
  98. }
  99. }