Added IsInstalledOnClient to Game

This commit is contained in:
Luke Pulverenti 2013-09-22 18:42:21 -04:00
parent 02b34c6393
commit 831c412ecf
4 changed files with 51 additions and 1 deletions

View File

@ -118,9 +118,11 @@ namespace MediaBrowser.Api
var games = items.OfType<Game>().ToList();
summary.ClientInstalledGameCount = games.Count(i => !i.IsInstalledOnClient);
summary.GameCount = games.Count;
summary.GameFileExtensions = games.Select(i => Path.GetExtension(i.Path))
summary.GameFileExtensions = games.Where(i => !i.IsInstalledOnClient).Select(i => Path.GetExtension(i.Path))
.Distinct(StringComparer.OrdinalIgnoreCase)
.ToList();

View File

@ -24,6 +24,12 @@ namespace MediaBrowser.Controller.Entities
/// <value>The players supported.</value>
public int? PlayersSupported { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is installed on client.
/// </summary>
/// <value><c>true</c> if this instance is installed on client; otherwise, <c>false</c>.</value>
public bool IsInstalledOnClient { get; set; }
/// <summary>
/// Gets or sets the game system.
/// </summary>

View File

@ -139,6 +139,7 @@ namespace MediaBrowser.Controller.Providers
break;
}
case "CriticRating":
{
var text = reader.ReadElementContentAsString();
@ -150,6 +151,7 @@ namespace MediaBrowser.Controller.Providers
break;
}
case "Budget":
{
var text = reader.ReadElementContentAsString();
@ -161,6 +163,7 @@ namespace MediaBrowser.Controller.Providers
break;
}
case "Revenue":
{
var text = reader.ReadElementContentAsString();
@ -172,6 +175,7 @@ namespace MediaBrowser.Controller.Providers
break;
}
case "SortTitle":
{
var val = reader.ReadElementContentAsString();
@ -466,6 +470,7 @@ namespace MediaBrowser.Controller.Providers
break;
}
case "ReleaseYear":
case "ProductionYear":
{
var val = reader.ReadElementContentAsString();
@ -555,6 +560,37 @@ namespace MediaBrowser.Controller.Providers
}
break;
case "Players":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
int num;
// All external meta is saving this as '.' for decimal I believe...but just to be sure
if (int.TryParse(val, NumberStyles.Integer, _usCulture, out num))
{
var game = item as Game;
if (game != null)
{
game.PlayersSupported = num;
}
}
}
break;
}
case "GameSystem":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
var game = item as Game;
if (game != null)
{
game.GameSystem = val;
}
}
break;
}
case "MusicbrainzId":
{
var mbz = reader.ReadElementContentAsString();

View File

@ -31,6 +31,12 @@ namespace MediaBrowser.Model.Dto
/// <value>The game extensions.</value>
public List<string> GameFileExtensions { get; set; }
/// <summary>
/// Gets or sets the client installed game count.
/// </summary>
/// <value>The client installed game count.</value>
public int ClientInstalledGameCount { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="GameSystemSummary"/> class.
/// </summary>