Game.cs 2.5 KB

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