aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2020-09-13 17:45:17 +0100
committerGitHub <noreply@github.com>2020-09-13 17:45:17 +0100
commit6c2c2cb872b0e98ff27d1cc8d664a185e63e39ac (patch)
tree939c53b6e32c600b436711e612aee37f5ae4139e /Emby.Server.Implementations/ApplicationHost.cs
parentea0eb9a6ffc8a667c9d9d455121d3f48d72fa360 (diff)
Update ApplicationHost.cs
Global jsonserializer added
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index db70b6203..ea4c77f3c 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -121,6 +121,7 @@ namespace Emby.Server.Implementations
private readonly IFileSystem _fileSystemManager;
private readonly INetworkManager _networkManager;
private readonly IXmlSerializer _xmlSerializer;
+ private readonly IJsonSerializer _jsonSerializer;
private readonly IStartupOptions _startupOptions;
private IMediaEncoder _mediaEncoder;
@@ -251,6 +252,8 @@ namespace Emby.Server.Implementations
IServiceCollection serviceCollection)
{
_xmlSerializer = new MyXmlSerializer();
+ _jsonSerializer = new JsonSerializer();
+
ServiceCollection = serviceCollection;
_networkManager = networkManager;
@@ -1049,12 +1052,11 @@ namespace Emby.Server.Implementations
var versions = new List<(Version PluginVersion, string Name, string Path)>();
var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly);
- var serializer = new JsonSerializer();
foreach (var dir in directories)
{
try
{
- var manifest = serializer.DeserializeFromFile<PlugInManifest>(Path.Combine(dir, "meta.json");
+ var manifest = _jsonSerializer.DeserializeFromFile<PlugInManifest>(Path.Combine(dir, "meta.json");
if (!Version.TryParse(manifest.TargetAbi, out var targetAbi))
{