Minor settings migration bug fix

This commit is contained in:
unknown 2015-07-19 10:35:56 -06:00
parent 7aecb9ac68
commit c81c6b1e68
1 changed files with 14 additions and 10 deletions

View File

@ -25,7 +25,7 @@ namespace Jackett.Services
string ApplicationFolder();
}
public class ConfigurationService: IConfigurationService
public class ConfigurationService : IConfigurationService
{
private ISerializeService serializeService;
private Logger logger;
@ -61,14 +61,18 @@ namespace Jackett.Services
foreach (var file in Directory.GetFiles(oldDir, "*", SearchOption.AllDirectories))
{
var path = file.Replace(oldDir, "");
var destFolder = GetAppDataFolder()+ path;
var destFolder = GetAppDataFolder() + path;
if (!Directory.Exists(Path.GetDirectoryName(destFolder)))
{
Directory.CreateDirectory(Path.GetDirectoryName(destFolder));
}
if (!File.Exists(destFolder))
{
File.Move(file, destFolder);
}
}
Directory.Delete(oldDir, true);
}
}
catch (Exception ex)
{
@ -90,7 +94,7 @@ namespace Jackett.Services
return serializeService.DeSerialise<T>(File.ReadAllText(fullPath));
}
catch(Exception e)
catch (Exception e)
{
logger.Error(e, "Error reading config file " + fullPath);
return default(T);