aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Games/GameSystemXmlProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Providers/Games/GameSystemXmlProvider.cs')
-rw-r--r--MediaBrowser.Providers/Games/GameSystemXmlProvider.cs39
1 files changed, 5 insertions, 34 deletions
diff --git a/MediaBrowser.Providers/Games/GameSystemXmlProvider.cs b/MediaBrowser.Providers/Games/GameSystemXmlProvider.cs
index 61fb791e6..3e74f4c32 100644
--- a/MediaBrowser.Providers/Games/GameSystemXmlProvider.cs
+++ b/MediaBrowser.Providers/Games/GameSystemXmlProvider.cs
@@ -4,11 +4,10 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
using System.IO;
using System.Threading;
-using System.Threading.Tasks;
namespace MediaBrowser.Providers.Games
{
- public class GameSystemXmlProvider : BaseXmlProvider, ILocalMetadataProvider<GameSystem>
+ public class GameSystemXmlProvider : BaseXmlProvider<GameSystem>
{
private readonly ILogger _logger;
@@ -18,42 +17,14 @@ namespace MediaBrowser.Providers.Games
_logger = logger;
}
- public async Task<MetadataResult<GameSystem>> GetMetadata(string path, CancellationToken cancellationToken)
+ protected override void Fetch(GameSystem item, string path, CancellationToken cancellationToken)
{
- path = GetXmlFile(path).FullName;
-
- var result = new MetadataResult<GameSystem>();
-
- await XmlParsingResourcePool.WaitAsync(cancellationToken).ConfigureAwait(false);
-
- try
- {
- var item = new GameSystem();
-
- new GameSystemXmlParser(_logger).Fetch(item, path, cancellationToken);
- result.HasMetadata = true;
- result.Item = item;
- }
- catch (FileNotFoundException)
- {
- result.HasMetadata = false;
- }
- finally
- {
- XmlParsingResourcePool.Release();
- }
-
- return result;
- }
-
- public string Name
- {
- get { return "Media Browser Xml"; }
+ new GameSystemXmlParser(_logger).Fetch(item, path, cancellationToken);
}
- protected override FileInfo GetXmlFile(string path)
+ protected override FileInfo GetXmlFile(ItemInfo info)
{
- return new FileInfo(Path.Combine(path, "gamesystem.xml"));
+ return new FileInfo(Path.Combine(info.Path, "gamesystem.xml"));
}
}
}