Game.cs 2.3 KB

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