aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Plugins/BasePlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common/Plugins/BasePlugin.cs')
-rw-r--r--MediaBrowser.Common/Plugins/BasePlugin.cs41
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)