2014-01-17 14:18:43 -07:00
|
|
|
|
using System.Runtime.Serialization;
|
2014-02-06 20:10:13 -07:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2014-01-17 14:18:43 -07:00
|
|
|
|
using MediaBrowser.Model.Configuration;
|
2013-12-26 09:53:23 -07:00
|
|
|
|
using System;
|
2014-12-19 23:06:27 -07:00
|
|
|
|
using MediaBrowser.Model.Users;
|
2013-09-21 14:00:04 -07:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Entities
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class GameSystem
|
|
|
|
|
/// </summary>
|
2014-02-06 20:10:13 -07:00
|
|
|
|
public class GameSystem : Folder, IHasLookupInfo<GameSystemInfo>
|
2013-09-21 14:00:04 -07:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Return the id that should be used to key display prefs for this item.
|
|
|
|
|
/// Default is based on the type for everything except actual generic folders.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The display prefs id.</value>
|
2014-01-17 14:18:43 -07:00
|
|
|
|
[IgnoreDataMember]
|
2013-09-21 14:00:04 -07:00
|
|
|
|
public override Guid DisplayPreferencesId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Id;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-22 09:49:55 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the game system.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The game system.</value>
|
|
|
|
|
public string GameSystemName { get; set; }
|
2013-10-01 16:33:50 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the user data key.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>System.String.</returns>
|
2015-01-24 15:33:26 -07:00
|
|
|
|
protected override string CreateUserDataKey()
|
2013-10-01 16:33:50 -07:00
|
|
|
|
{
|
2013-10-04 17:44:43 -07:00
|
|
|
|
if (!string.IsNullOrEmpty(GameSystemName))
|
|
|
|
|
{
|
|
|
|
|
return "GameSystem-" + GameSystemName;
|
|
|
|
|
}
|
2015-01-24 15:33:26 -07:00
|
|
|
|
return base.CreateUserDataKey();
|
2013-10-01 16:33:50 -07:00
|
|
|
|
}
|
2013-12-26 09:53:23 -07:00
|
|
|
|
|
2014-12-19 23:06:27 -07:00
|
|
|
|
protected override bool GetBlockUnratedValue(UserPolicy config)
|
2013-12-26 09:53:23 -07:00
|
|
|
|
{
|
|
|
|
|
// Don't block. Determine by game
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2014-02-06 20:10:13 -07:00
|
|
|
|
|
2015-11-06 08:02:22 -07:00
|
|
|
|
public override UnratedItem GetBlockUnratedType()
|
|
|
|
|
{
|
|
|
|
|
return UnratedItem.Game;
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-06 20:10:13 -07:00
|
|
|
|
public GameSystemInfo GetLookupInfo()
|
|
|
|
|
{
|
|
|
|
|
var id = GetItemLookupInfo<GameSystemInfo>();
|
|
|
|
|
|
|
|
|
|
id.Path = Path;
|
|
|
|
|
|
|
|
|
|
return id;
|
|
|
|
|
}
|
2015-06-28 18:10:45 -07:00
|
|
|
|
|
|
|
|
|
[IgnoreDataMember]
|
|
|
|
|
public override bool SupportsPeople
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-21 14:00:04 -07:00
|
|
|
|
}
|
|
|
|
|
}
|