mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added PetaPoco
This commit is contained in:
@@ -10,6 +10,7 @@ using NzbDrone.Core.Instrumentation;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Repository;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
using PetaPoco;
|
||||
using SubSonic.DataProviders;
|
||||
using SubSonic.Repository;
|
||||
|
||||
@@ -38,7 +39,7 @@ namespace NzbDrone.Core.Test.Framework
|
||||
|
||||
public static IRepository GetEmptyRepository(bool enableLogging = false, string fileName = "")
|
||||
{
|
||||
Console.WriteLine("Creating an empty SQLite database");
|
||||
Console.WriteLine("Creating an empty Subsonic repository");
|
||||
|
||||
if (String.IsNullOrWhiteSpace(fileName))
|
||||
{
|
||||
@@ -50,7 +51,7 @@ namespace NzbDrone.Core.Test.Framework
|
||||
var repo = Connection.CreateSimpleRepository(provider);
|
||||
ForceMigration(repo);
|
||||
|
||||
Migrations.Run(Connection.GetConnectionString(fileName), false);
|
||||
//Migrations.Run(Connection.GetConnectionString(fileName), false);
|
||||
|
||||
if (enableLogging)
|
||||
{
|
||||
@@ -62,6 +63,24 @@ namespace NzbDrone.Core.Test.Framework
|
||||
return repo;
|
||||
}
|
||||
|
||||
public static IDatabase GetEmptyDatabase(bool enableLogging = false, string fileName = "")
|
||||
{
|
||||
Console.WriteLine("Creating an empty PetaPoco database");
|
||||
|
||||
if (String.IsNullOrWhiteSpace(fileName))
|
||||
{
|
||||
fileName = Guid.NewGuid() + ".db";
|
||||
}
|
||||
|
||||
var connectionString = Connection.GetConnectionString(fileName);
|
||||
|
||||
MigrationsHelper.MigrateDatabase(connectionString);
|
||||
|
||||
var database = Connection.GetPetaPocoDb(connectionString);
|
||||
|
||||
return database;
|
||||
}
|
||||
|
||||
public static DiskProvider GetStandardDisk(int seasons, int episodes)
|
||||
{
|
||||
var mock = new Mock<DiskProvider>();
|
||||
|
Reference in New Issue
Block a user