Skip to content

Commit

Permalink
Fix predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
AndMu committed Dec 7, 2017
1 parent e08d890 commit ea0440a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ public void CanDownload()
var result = instance.CanDownload(null, "Test.file", DateTime.Now);
Assert.IsFalse(result);
result = instance.CanDownload(DateTime.Now, "Test.file", DateTime.Now);
Assert.IsTrue(result);
result = instance.CanDownload(null, "Test.file", DateTime.Now);
Assert.IsFalse(result);
instance.Downloaded("Test.file");
result = instance.CanDownload(DateTime.Now, "Test.file", DateTime.Now);
result = instance.CanDownload(null, "Test.file", DateTime.Now);
Assert.IsFalse(result);

result = instance.CanDownload(DateTime.Now, "Test2.file", DateTime.Now);
Expand Down
5 changes: 5 additions & 0 deletions src/YiScanner/Client/Predicates/NewFilesPredicate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public bool CanDownload(DateTime? lastScan, string file, DateTime modified)
return false;
}

if (lastScan == null)
{
table[file] = true;
}

return lastScan != null;
}

Expand Down

0 comments on commit ea0440a

Please sign in to comment.