diff options
| author | Jim Cartlidge <jimcartlidge@yahoo.co.uk> | 2020-09-14 18:23:50 +0100 |
|---|---|---|
| committer | Jim Cartlidge <jimcartlidge@yahoo.co.uk> | 2020-09-14 18:23:50 +0100 |
| commit | d27d2a8990afb80ba137688121f85b831599d45a (patch) | |
| tree | 29b2d044340454cc847d082a7921d2c1c5e18e23 /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | f73e744785fc8016e858c9f676ac0b04ee4f564b (diff) | |
Renamed file.
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 878ea30fc..d1e28cce5 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1051,27 +1051,38 @@ namespace Emby.Server.Implementations var dllList = new List<string>(); var versions = new List<(Version PluginVersion, string Name, string Path)>(); var directories = Directory.EnumerateDirectories(path, "*.*", SearchOption.TopDirectoryOnly); + string metafile; foreach (var dir in directories) { try { - var manifest = _jsonSerializer.DeserializeFromFile<PlugInManifest>(Path.Combine(dir, "meta.json")); - - if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) + metafile = Path.Combine(dir, "meta.json"); + if (File.Exists(metafile)) { - targetAbi = new Version(0, 0, 0, 1); - } + var manifest = _jsonSerializer.DeserializeFromFile<PluginManifest>(metafile); - if (!Version.TryParse(manifest.Version, out var version)) - { - version = new Version(0, 0, 0, 1); - } + if (!Version.TryParse(manifest.TargetAbi, out var targetAbi)) + { + targetAbi = new Version(0, 0, 0, 1); + } - if (targetAbi >= ApplicationVersion) + if (!Version.TryParse(manifest.Version, out var version)) + { + version = new Version(0, 0, 0, 1); + } + + if (ApplicationVersion <= targetAbi) + { + // Only load Plugins if the plugin is built for this version or below. + versions.Add((version, manifest.Name, dir)); + } + } + else { - // Only load Plugins for this version or below. - versions.Add((version, manifest.Name, dir)); + metafile = dir.Split(new char[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).Last(); + // Add it under the path name and version 0.0.0.1. + versions.Add((new Version("0.0.0.1"), metafile, dir)); } } catch |
