mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Starting path clean up. (All paths should go through EnvironmentProvider)
This commit is contained in:
parent
5b3f0bdffe
commit
cd32a70179
14 changed files with 72 additions and 82 deletions
|
@ -1,17 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Model;
|
||||
|
||||
namespace NzbDrone.Core.Providers.Core
|
||||
{
|
||||
public class ConfigFileProvider
|
||||
{
|
||||
private string _configFile = Path.Combine(new EnviromentProvider().AppPath, "App_Data", "Config.xml");
|
||||
private string _configFile = Path.Combine(new EnviromentProvider().AppDataPath, "Config.xml");
|
||||
|
||||
public string ConfigFile
|
||||
{
|
||||
|
@ -112,22 +110,14 @@ namespace NzbDrone.Core.Providers.Core
|
|||
|
||||
public virtual void CreateDefaultConfigFile()
|
||||
{
|
||||
//Create the config file here
|
||||
Directory.CreateDirectory(Path.Combine(new EnviromentProvider().AppPath, "App_Data"));
|
||||
|
||||
if (!File.Exists(ConfigFile))
|
||||
{
|
||||
WriteDefaultConfig();
|
||||
var xDoc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));
|
||||
|
||||
xDoc.Add(new XElement("Config"));
|
||||
|
||||
xDoc.Save(ConfigFile);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void WriteDefaultConfig()
|
||||
{
|
||||
var xDoc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));
|
||||
|
||||
xDoc.Add(new XElement("Config"));
|
||||
|
||||
xDoc.Save(ConfigFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue