1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-11 12:02:35 +02:00

more cleanup.

This commit is contained in:
kay.one 2013-03-25 00:36:22 -07:00
parent ea4f0dbe5f
commit b6fc731db8
3 changed files with 7 additions and 15 deletions

View File

@ -55,17 +55,7 @@ public int Count()
public TModel Get(int id)
{
try
{
var c = _dataMapper.Query<TModel>().FromTable(typeof(TModel).Name);
return null;
}
catch (ArgumentNullException e)
{
throw new InvalidOperationException(e.Message);
}
return _dataMapper.Query<TModel>().Single(c => c.Id == id);
}
@ -161,7 +151,7 @@ public void UpdateFields<TKey>(TModel model, Expression<Func<TModel, TKey>> only
throw new InvalidOperationException("Attempted to updated model without ID");
}
// _database.UpdateOnly(model, onlyFields, m => m.Id == model.Id);
// _database.UpdateOnly(model, onlyFields, m => m.Id == model.Id);
}
}
}

View File

@ -1,5 +1,4 @@
using System;
using System.Data;
using Marr.Data;
using Mono.Data.Sqlite;
using NzbDrone.Core.Datastore.Migration.Framework;
@ -27,7 +26,10 @@ public IDatabase Create(string dbPath, MigrationType migrationType = MigrationTy
var connectionString = GetConnectionString(dbPath);
_migrationController.MigrateToLatest(connectionString, migrationType);
var dataMapper = new DataMapper(SqliteFactory.Instance, connectionString);
var dataMapper = new DataMapper(SqliteFactory.Instance, connectionString)
{
SqlMode = SqlModes.Text,
};
return new Database(dataMapper);
}

View File

@ -33,7 +33,7 @@ public JobDefinition GetDefinition(Type type)
public IList<JobDefinition> GetPendingJobs()
{
return Queryable().Where(c => c.Enable && c.LastExecution < DateTime.Now.AddMinutes(-c.Interval)).ToList();
return Queryable().Where(c => c.Enable == false && c.Interval != 2).ToList().Where(c => c.LastExecution < DateTime.Now.AddMinutes(-c.Interval)).ToList();
}
public void Init()