Update ApplicationHost.cs
Global jsonserializer added
This commit is contained in:
parent
ea0eb9a6ff
commit
6c2c2cb872
|
@ -121,6 +121,7 @@ namespace Emby.Server.Implementations
|
||||||
private readonly IFileSystem _fileSystemManager;
|
private readonly IFileSystem _fileSystemManager;
|
||||||
private readonly INetworkManager _networkManager;
|
private readonly INetworkManager _networkManager;
|
||||||
private readonly IXmlSerializer _xmlSerializer;
|
private readonly IXmlSerializer _xmlSerializer;
|
||||||
|
private readonly IJsonSerializer _jsonSerializer;
|
||||||
private readonly IStartupOptions _startupOptions;
|
private readonly IStartupOptions _startupOptions;
|
||||||
|
|
||||||
private IMediaEncoder _mediaEncoder;
|
private IMediaEncoder _mediaEncoder;
|
||||||
|
@ -251,6 +252,8 @@ namespace Emby.Server.Implementations
|
||||||
IServiceCollection serviceCollection)
|
IServiceCollection serviceCollection)
|
||||||
{
|
{
|
||||||
_xmlSerializer = new MyXmlSerializer();
|
_xmlSerializer = new MyXmlSerializer();
|
||||||
|
_jsonSerializer = new JsonSerializer();
|
||||||
|
|
||||||
ServiceCollection = serviceCollection;
|
ServiceCollection = serviceCollection;
|
||||||
|
|
||||||
_networkManager = networkManager;
|
_networkManager = networkManager;
|
||||||
|
@ -1049,12 +1052,11 @@ namespace Emby.Server.Implementations
|
||||||
var versions = new List<(Version PluginVersion, string Name, string Path)>();
|
var versions = new List<(Version PluginVersion, string Name, string Path)>();
|
||||||
var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly);
|
var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly);
|
||||||
|
|
||||||
var serializer = new JsonSerializer();
|
|
||||||
foreach (var dir in directories)
|
foreach (var dir in directories)
|
||||||
{
|
{
|
||||||
try
|
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))
|
if (!Version.TryParse(manifest.TargetAbi, out var targetAbi))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user