mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
Making the configuration actually do something. Setting a default configuration if there is no DB
This commit is contained in:
parent
c49e9a386b
commit
f2399d6407
10 changed files with 171 additions and 75 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue