mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
cleaned up test db path for tests.
This commit is contained in:
parent
02c175950b
commit
dde91569ac
15 changed files with 123 additions and 133 deletions
|
@ -1,11 +1,8 @@
|
|||
using System.IO;
|
||||
using NLog;
|
||||
using NLog;
|
||||
using Nancy.Bootstrapper;
|
||||
using NzbDrone.Api;
|
||||
using NzbDrone.Api.SignalR;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Composition;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Instrumentation;
|
||||
|
@ -33,30 +30,9 @@ namespace NzbDrone
|
|||
Container.Register(typeof(IBasicRepository<NamingConfig>), typeof(BasicRepository<NamingConfig>));
|
||||
|
||||
Container.Register<INancyBootstrapper, NancyBootstrapper>();
|
||||
|
||||
InitDatabase();
|
||||
|
||||
}
|
||||
|
||||
private void InitDatabase()
|
||||
{
|
||||
Logger.Info("Registering Database...");
|
||||
|
||||
//TODO: move this to factory
|
||||
var IAppDirectoryInfo = new AppDirectoryInfo();
|
||||
var appDataPath = IAppDirectoryInfo.GetAppDataPath();
|
||||
|
||||
if (!Directory.Exists(appDataPath))
|
||||
{
|
||||
Directory.CreateDirectory(appDataPath);
|
||||
}
|
||||
|
||||
Container.Register(c => c.Resolve<IDbFactory>().Create(IAppDirectoryInfo.GetNzbDroneDatabase()));
|
||||
|
||||
Container.Register<ILogRepository>(c =>
|
||||
{
|
||||
var db = c.Resolve<IDbFactory>().Create(IAppDirectoryInfo.GetLogDatabase(), MigrationType.Log);
|
||||
return new LogRepository(db, c.Resolve<IMessageAggregator>());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue