aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreenback <jimcartlidge@yahoo.co.uk>2020-11-20 14:03:27 +0000
committerGreenback <jimcartlidge@yahoo.co.uk>2020-11-20 14:03:27 +0000
commit32b92641fbb068a89aeb47956e6ce0e98b1d3918 (patch)
tree394c9c240da7d280560c8b212c9f7ecde5114964
parent84fe0462266c377caa2dcc5a919230cab0fe694c (diff)
Get version info the manifest.
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 5d47d1e40..74e472be6 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -181,6 +181,8 @@ namespace Emby.Server.Implementations
private IPlugin[] _plugins;
+ private IEnumerable<LocalPlugin> _pluginsManifests;
+
/// <summary>
/// Gets the plugins.
/// </summary>
@@ -772,6 +774,23 @@ namespace Emby.Server.Implementations
foreach (var plugin in Plugins)
{
+ if (plugin is IPluginAssembly assemblyPlugin)
+ {
+ // Ensure the version number matches the Plugin Manifest information.
+ foreach (var item in _pluginsManifests)
+ {
+ if (item.Path.Equals(plugin.AssemblyFilePath, StringComparison.OrdinalIgnoreCase))
+ {
+ // Update version number to that of the manifest.
+ assemblyPlugin.SetAttributes(
+ plugin.AssemblyFilePath,
+ Path.Combine(ApplicationPaths.PluginsPath, Path.GetFileNameWithoutExtension(plugin.AssemblyFilePath)),
+ item.Version);
+ break;
+ }
+ }
+ }
+
pluginBuilder.Append(plugin.Name)
.Append(' ')
.Append(plugin.Version)
@@ -1093,7 +1112,8 @@ namespace Emby.Server.Implementations
{
if (Directory.Exists(ApplicationPaths.PluginsPath))
{
- foreach (var plugin in GetLocalPlugins(ApplicationPaths.PluginsPath))
+ _pluginsManifests = GetLocalPlugins(ApplicationPaths.PluginsPath);
+ foreach (var plugin in _pluginsManifests)
{
foreach (var file in plugin.DllFiles)
{