Game.cs 3.1 KB

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