Skip to content

Commit ea0440a

Browse files
committed
Fix predicate
1 parent e08d890 commit ea0440a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/Wikiled.YiScanner.Tests/Client/Predicates/NewFilesPredicateTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ public void CanDownload()
2121
var result = instance.CanDownload(null, "Test.file", DateTime.Now);
2222
Assert.IsFalse(result);
2323
result = instance.CanDownload(DateTime.Now, "Test.file", DateTime.Now);
24-
Assert.IsTrue(result);
25-
result = instance.CanDownload(null, "Test.file", DateTime.Now);
2624
Assert.IsFalse(result);
27-
instance.Downloaded("Test.file");
28-
result = instance.CanDownload(DateTime.Now, "Test.file", DateTime.Now);
25+
result = instance.CanDownload(null, "Test.file", DateTime.Now);
2926
Assert.IsFalse(result);
3027

3128
result = instance.CanDownload(DateTime.Now, "Test2.file", DateTime.Now);

src/YiScanner/Client/Predicates/NewFilesPredicate.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public bool CanDownload(DateTime? lastScan, string file, DateTime modified)
1414
return false;
1515
}
1616

17+
if (lastScan == null)
18+
{
19+
table[file] = true;
20+
}
21+
1722
return lastScan != null;
1823
}
1924

0 commit comments

Comments
 (0)