1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Core/Datastore/EloqueraDbFactory.cs

32 lines
882 B
C#
Raw Normal View History

2013-02-04 01:01:36 +03:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Eloquera.Client;
using NzbDrone.Common;
namespace NzbDrone.Core.Datastore
{
public class EloqueraDbFactory
{
private readonly EnvironmentProvider _environmentProvider;
public EloqueraDbFactory()
{
_environmentProvider = new EnvironmentProvider();
}
public EloqueraDb Create(string dbName = "NzbDrone", string dbFilename = "nzbdrone.eloq")
{
DB db = new DB();
DB.Configuration.ServerSettings.DatabasePath = Path.Combine(_environmentProvider.GetAppDataPath(), dbName);
db.CreateDatabase(dbName);
db.OpenDatabase(dbName);
db.RefreshMode = ObjectRefreshMode.AlwaysReturnUpdatedValues;
return new EloqueraDb(db);
}
}
}