using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; using System.Linq; namespace MediaBrowser.Controller.Entities { public class Game : BaseItem, IHasSoundtracks, IHasTrailers, IHasThemeMedia, IHasTags, IHasScreenshots, ISupportsPlaceHolders, IHasPreferredMetadataLanguage, IHasLookupInfo { 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(); RemoteTrailerIds = new List(); ThemeSongIds = new List(); ThemeVideoIds = new List(); Tags = new List(); } public List LocalTrailerIds { get; set; } public List RemoteTrailerIds { 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 a value indicating whether this instance is place holder. /// /// true if this instance is place holder; otherwise, false. public bool IsPlaceHolder { get; set; } /// /// Gets or sets the game system. /// /// The game system. public string GameSystem { get; set; } /// /// 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; } 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.BlockUnratedItems.Contains(UnratedItem.Game); } public GameInfo GetLookupInfo() { var id = GetItemLookupInfo(); id.GameSystem = GameSystem; return id; } /// /// Gets the trailer ids. /// /// List<Guid>. public List GetTrailerIds() { var list = LocalTrailerIds.ToList(); list.AddRange(RemoteTrailerIds); return list; } } }