Making the configuration actually do something. Setting a default configuration if there is no DB

This commit is contained in:
Jamie Rees 2016-03-04 23:19:48 +00:00
parent c49e9a386b
commit f2399d6407
10 changed files with 171 additions and 75 deletions

View file

@ -31,6 +31,8 @@ using System.IO;
using Mono.Data.Sqlite;
using NLog;
using PlexRequests.Helpers;
using PlexRequests.Store.Repository;
namespace PlexRequests.Store
{
@ -44,14 +46,16 @@ namespace PlexRequests.Store
private SqliteFactory Factory { get; set; }
public virtual void CheckDb()
public virtual bool CheckDb()
{
Log.Trace("Checking DB");
if (!File.Exists(DbFile))
{
Log.Trace("DB doesn't exist, creating a new one");
CreateDatabase();
return true;
}
return false;
}
public string DbFile = "RequestPlex.sqlite";