diff options
| author | Greenback <jimcartlidge@yahoo.co.uk> | 2020-12-18 09:04:40 +0000 |
|---|---|---|
| committer | Greenback <jimcartlidge@yahoo.co.uk> | 2020-12-18 09:04:40 +0000 |
| commit | 5a3efc526631b7f774b17ea5a8a54130696b6e25 (patch) | |
| tree | 70662341dfd1abe92a800a38d97b9cae55337262 /MediaBrowser.Common/Plugins/BasePlugin.cs | |
| parent | 4153551dfcd498114d240b0311b20df8799c1593 (diff) | |
Changes as required.
Diffstat (limited to 'MediaBrowser.Common/Plugins/BasePlugin.cs')
| -rw-r--r-- | MediaBrowser.Common/Plugins/BasePlugin.cs | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs index 5756f8852..5750c59c4 100644 --- a/MediaBrowser.Common/Plugins/BasePlugin.cs +++ b/MediaBrowser.Common/Plugins/BasePlugin.cs @@ -134,25 +134,11 @@ namespace MediaBrowser.Common.Plugins var assemblyName = assembly.GetName(); var assemblyFilePath = assembly.Location; - // Find out the plugin folder. - bool inPluginFolder = assemblyFilePath.StartsWith(ApplicationPaths.PluginsPath, StringComparison.OrdinalIgnoreCase); - string path, dataFolderPath; - - var configurationFileName = Path.ChangeExtension(Path.GetFileName(assemblyFilePath), ".xml"); - if (inPluginFolder) - { - // Normal plugin. - path = assemblyFilePath.Substring(ApplicationPaths.PluginsPath.Length).Split('\\', StringSplitOptions.RemoveEmptyEntries)[0]; - dataFolderPath = Path.Combine( - Path.Combine(ApplicationPaths.PluginsPath, path), - configurationFileName); - ConfigurationFilePath = dataFolderPath; - } - else + var dataFolderPath = Path.Combine(ApplicationPaths.PluginsPath, Path.GetFileNameWithoutExtension(assemblyFilePath)); + if (!Directory.Exists(dataFolderPath)) { - // Provider - dataFolderPath = Path.Combine(ApplicationPaths.PluginsPath, Path.GetFileNameWithoutExtension(assemblyFilePath)); - ConfigurationFilePath = Path.Combine(ApplicationPaths.PluginConfigurationsPath, configurationFileName); + // Try again with the version number appended to the folder name. + dataFolderPath = dataFolderPath + "_" + Version.ToString(); } assemblyPlugin.SetAttributes(assemblyFilePath, dataFolderPath, assemblyName.Version); @@ -165,25 +151,6 @@ namespace MediaBrowser.Common.Plugins assemblyPlugin.SetId(assemblyId); } - - // TODO : Remove this, once migration support is ceased. - if (inPluginFolder) - { - var oldConfigFilePath = Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName); - - if (!File.Exists(ConfigurationFilePath) && File.Exists(oldConfigFilePath)) - { - // Migrate pre 10.7 settings, as different plugin versions may have different settings. - try - { - File.Copy(oldConfigFilePath, ConfigurationFilePath); - } - catch - { - // Unable to migrate settings. - } - } - } } if (this is IHasPluginConfiguration hasPluginConfiguration) |
