using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using System; namespace MediaBrowser.Controller.Entities { public class Game : BaseItem, IHasTrailers, IHasScreenshots, ISupportsPlaceHolders, IHasLookupInfo { public Game() { MultiPartGameFiles = new string[] {}; RemoteTrailers = EmptyMediaUrlArray; LocalTrailerIds = new Guid[] {}; RemoteTrailerIds = new Guid[] {}; } public Guid[] LocalTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; } public override bool CanDownload() { return IsFileProtocol; } [IgnoreDataMember] public override bool SupportsThemeMedia { get { return true; } } [IgnoreDataMember] public override bool SupportsPeople { get { return false; } } /// /// Gets or sets the remote trailers. /// /// The remote trailers. public MediaUrl[] RemoteTrailers { get; set; } /// /// Gets the type of the media. /// /// The type of the media. [IgnoreDataMember] 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 string[] MultiPartGameFiles { get; set; } public override List GetUserDataKeys() { var list = base.GetUserDataKeys(); var id = this.GetProviderId(MetadataProviders.Gamesdb); if (!string.IsNullOrEmpty(id)) { list.Insert(0, "Game-Gamesdb-" + id); } return list; } public override IEnumerable GetDeletePaths() { if (!IsInMixedFolder) { return new[] { new FileSystemMetadata { FullName = FileSystem.GetDirectoryName(Path), IsDirectory = true } }; } return base.GetDeletePaths(); } public override UnratedItem GetBlockUnratedType() { return UnratedItem.Game; } public GameInfo GetLookupInfo() { var id = GetItemLookupInfo(); id.GameSystem = GameSystem; return id; } } }