Game.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. 
  2. namespace MediaBrowser.Controller.Entities
  3. {
  4. public class Game : BaseItem
  5. {
  6. /// <summary>
  7. /// Gets the type of the media.
  8. /// </summary>
  9. /// <value>The type of the media.</value>
  10. public override string MediaType
  11. {
  12. get { return Model.Entities.MediaType.Game; }
  13. }
  14. /// <summary>
  15. /// Gets or sets the players supported.
  16. /// </summary>
  17. /// <value>The players supported.</value>
  18. public int? PlayersSupported { get; set; }
  19. /// <summary>
  20. /// Gets or sets the game system.
  21. /// </summary>
  22. /// <value>The game system.</value>
  23. public string GameSystem { get; set; }
  24. /// <summary>
  25. /// Returns true if the game is combined with other games in the same folder
  26. /// </summary>
  27. public bool IsInMixedFolder { get; set; }
  28. /// <summary>
  29. ///
  30. /// </summary>
  31. public override string MetaLocation
  32. {
  33. get
  34. {
  35. var directoryName = System.IO.Path.GetDirectoryName(Path);
  36. if (IsInMixedFolder)
  37. {
  38. // It's a file
  39. var baseMetaPath = System.IO.Path.Combine(directoryName, "metadata");
  40. var fileName = System.IO.Path.GetFileNameWithoutExtension(Path);
  41. return fileName != null ? System.IO.Path.Combine(baseMetaPath, fileName) : null;
  42. }
  43. return directoryName;
  44. }
  45. }
  46. /// <summary>
  47. ///
  48. /// </summary>
  49. protected override bool UseParentPathToCreateResolveArgs
  50. {
  51. get
  52. {
  53. return !IsInMixedFolder;
  54. }
  55. }
  56. }
  57. }