using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; namespace MediaBrowser.Controller.Entities { public class Game : BaseItem, IHasSoundtracks, IHasTrailers, IHasThemeMedia, IHasTags, IHasScreenshots, IHasPreferredMetadataLanguage { public List SoundtrackIds { get; set; } public List ThemeSongIds { get; set; } public List ThemeVideoIds { get; set; } public string PreferredMetadataLanguage { get; set; } /// /// Gets or sets the preferred metadata country code. /// /// The preferred metadata country code. public string PreferredMetadataCountryCode { get; set; } public Game() { MultiPartGameFiles = new List(); SoundtrackIds = new List(); RemoteTrailers = new List(); LocalTrailerIds = new List(); ThemeSongIds = new List(); ThemeVideoIds = new List(); Tags = new List(); ScreenshotImagePaths = new List(); } public List LocalTrailerIds { get; set; } /// /// Gets or sets the screenshot image paths. /// /// The screenshot image paths. public List ScreenshotImagePaths { get; set; } /// /// Gets or sets the tags. /// /// The tags. public List Tags { get; set; } /// /// Gets or sets the remote trailers. /// /// The remote trailers. public List RemoteTrailers { get; set; } /// /// Gets the type of the media. /// /// The type of the media. public override string MediaType { get { return Model.Entities.MediaType.Game; } } /// /// Gets or sets the players supported. /// /// The players supported. public int? PlayersSupported { get; set; } /// /// Gets or sets a value indicating whether this instance is installed on client. /// /// true if this instance is installed on client; otherwise, false. public bool IsInstalledOnClient { get; set; } /// /// Gets or sets the game system. /// /// The game system. public string GameSystem { get; set; } /// /// /// public override string MetaLocation { get { return System.IO.Path.GetDirectoryName(Path); } } /// /// Gets or sets a value indicating whether this instance is multi part. /// /// true if this instance is multi part; otherwise, false. public bool IsMultiPart { get; set; } /// /// Holds the paths to the game files in the event this is a multipart game /// public List MultiPartGameFiles { get; set; } /// /// /// protected override bool UseParentPathToCreateResolveArgs { get { return !IsInMixedFolder; } } public override string GetUserDataKey() { var id = this.GetProviderId(MetadataProviders.Gamesdb); if (!string.IsNullOrEmpty(id)) { return "Game-Gamesdb-" + id; } return base.GetUserDataKey(); } public override IEnumerable GetDeletePaths() { if (!IsInMixedFolder) { return new[] { System.IO.Path.GetDirectoryName(Path) }; } return base.GetDeletePaths(); } protected override bool GetBlockUnratedValue(UserConfiguration config) { return config.BlockUnratedGames; } } }