3D bug with search history cleanup fixed

Fixed: Search History Cleanup Job logic was backwards
This commit is contained in:
Mark McDowall 2012-08-14 16:53:55 -07:00
parent c2a1df61f6
commit bd44b2899a
2 changed files with 2 additions and 3 deletions

View File

@ -70,7 +70,7 @@ namespace NzbDrone.Core.Test.ProviderTests
{
var history = Builder<SearchHistory>.CreateListOfSize(10)
.All()
.With(h => h.SearchTime = DateTime.Now.AddDays(10))
.With(h => h.SearchTime = DateTime.Now.AddDays(-10))
.Build();
foreach(var searchHistory in history)

View File

@ -112,7 +112,6 @@ namespace NzbDrone.Core.Providers
parseResult.NzbUrl = item.NzbUrl;
parseResult.Series = series;
parseResult.Indexer = item.Indexer;
var episodes = _episodeProvider.GetEpisodesByParseResult(parseResult);
logger.Info("Forcing Download of: {0}", item.ReportTitle);
_downloadProvider.DownloadReport(parseResult);
@ -120,7 +119,7 @@ namespace NzbDrone.Core.Providers
public virtual void Cleanup()
{
var ids = _database.Fetch<int>("SELECT Id FROM SearchHistory WHERE SearchTime > @0", DateTime.Now.AddDays(7));
var ids = _database.Fetch<int>("SELECT Id FROM SearchHistory WHERE SearchTime < @0", DateTime.Now.AddDays(-7));
if (ids.Any())
{