fixes for game xml saving

This commit is contained in:
Luke Pulverenti 2013-07-01 14:27:19 -04:00
parent 708a8115d5
commit 01fc446427
2 changed files with 19 additions and 4 deletions

View File

@ -1,9 +1,9 @@
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
using ServiceStack.ServiceHost;
using System;
@ -19,7 +19,7 @@ namespace MediaBrowser.Api.UserLibrary
{
public GetGameGenres()
{
IncludeItemTypes = typeof(Audio).Name;
MediaTypes = MediaType.Game;
}
}

View File

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Configuration;
using System.Security;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Providers.Movies;
@ -56,14 +57,28 @@ namespace MediaBrowser.Providers.Savers
builder.Append("<Item>");
var game = (Game)item;
if (game.PlayersSupported.HasValue)
{
builder.Append("<Players>" + SecurityElement.Escape(game.PlayersSupported.Value.ToString(UsCulture)) + "</Players>");
}
if (!string.IsNullOrEmpty(game.GameSystem))
{
builder.Append("<GameSystem><![CDATA[" + game.GameSystem + "]]></GameSystem>");
}
XmlSaverHelpers.AddCommonNodes(item, builder);
builder.Append("</Item>");
var xmlFilePath = GetSavePath(item);
XmlSaverHelpers.Save(builder, xmlFilePath, new string[]
XmlSaverHelpers.Save(builder, xmlFilePath, new[]
{
"Players",
"GameSystem"
});
// Set last refreshed so that the provider doesn't trigger after the file save