3D bug with search history cleanup fixed

Fixed: Search History Cleanup Job logic was backwards
pull/4/head
Mark McDowall 12 years ago
parent c2a1df61f6
commit bd44b2899a

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

@ -112,7 +112,6 @@ namespace NzbDrone.Core.Providers
parseResult.NzbUrl = item.NzbUrl; parseResult.NzbUrl = item.NzbUrl;
parseResult.Series = series; parseResult.Series = series;
parseResult.Indexer = item.Indexer; parseResult.Indexer = item.Indexer;
var episodes = _episodeProvider.GetEpisodesByParseResult(parseResult);
logger.Info("Forcing Download of: {0}", item.ReportTitle); logger.Info("Forcing Download of: {0}", item.ReportTitle);
_downloadProvider.DownloadReport(parseResult); _downloadProvider.DownloadReport(parseResult);
@ -120,7 +119,7 @@ namespace NzbDrone.Core.Providers
public virtual void Cleanup() 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()) if (ids.Any())
{ {

Loading…
Cancel
Save