mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -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
|
@ -4,6 +4,7 @@ using System.Data.Common;
|
|||
using System.Data.SqlServerCe;
|
||||
using System.IO;
|
||||
using MvcMiniProfiler.Data;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Providers;
|
||||
using PetaPoco;
|
||||
|
||||
|
@ -11,11 +12,10 @@ namespace NzbDrone.Core.Datastore
|
|||
{
|
||||
public static class Connection
|
||||
{
|
||||
private static readonly DirectoryInfo AppDataPath = new DirectoryInfo(Path.Combine(new EnviromentProvider().AppPath, "App_Data"));
|
||||
private static EnviromentProvider _enviromentProvider = new EnviromentProvider();
|
||||
|
||||
static Connection()
|
||||
{
|
||||
if (!AppDataPath.Exists) AppDataPath.Create();
|
||||
Database.Mapper = new CustomeMapper();
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace NzbDrone.Core.Datastore
|
|||
{
|
||||
get
|
||||
{
|
||||
return GetConnectionString(Path.Combine(AppDataPath.FullName, "nzbdrone.sdf"));
|
||||
return GetConnectionString(Path.Combine(_enviromentProvider.AppDataPath, "nzbdrone.sdf"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace NzbDrone.Core.Datastore
|
|||
{
|
||||
get
|
||||
{
|
||||
return GetConnectionString(Path.Combine(AppDataPath.FullName, "log.sdf"));
|
||||
return GetConnectionString(Path.Combine(_enviromentProvider.AppDataPath, "log.sdf"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue