updated the apppath logic and db location

This commit is contained in:
kay.one 2010-09-23 19:19:55 -07:00
commit 036b2e7f4f
11 changed files with 178 additions and 42 deletions

View file

@ -1,4 +1,6 @@
using System;
using System.IO;
using System.Web;
using log4net;
using Ninject;
using NzbDrone.Core.Controllers;
@ -12,8 +14,8 @@ namespace NzbDrone.Core
public static void BindKernel(IKernel kernel)
{
var provider = ProviderFactory.GetProvider("Data Source=filename;Version=3;", "System.Data.SQLite");
string connectionString = String.Format("Data Source={0};Version=3;",Path.Combine(AppPath, "nzbdrone.db")) ;
var provider = ProviderFactory.GetProvider(connectionString, "System.Data.SQLite");
kernel.Bind<ISeriesController>().To<SeriesController>();
kernel.Bind<IDiskController>().To<DiskController>();
@ -24,11 +26,11 @@ namespace NzbDrone.Core
}
private static string _appPath;
public static String AppPath
{
get { throw new ApplicationException(); }
get { return new DirectoryInfo(HttpContext.Current.Server.MapPath("\\")).Parent.FullName; }
}
}
}