Fixed a bit of a stupid bug in the resetter and added unit tests around it to make sure this never happens again.

This commit is contained in:
tidusjar 2016-06-29 09:42:17 +01:00
commit 2d0b87b558
6 changed files with 507 additions and 349 deletions

View file

@ -109,7 +109,8 @@ namespace PlexRequests.Services.Jobs
var users = allUsers.Where(x => x.RequestType == type);
foreach (var u in users)
{
if (u.FirstRequestDate > DateTime.UtcNow.AddDays(-7))
var daysDiff = (u.FirstRequestDate - DateTime.UtcNow.AddDays(-7)).Days;
if (daysDiff <= 0)
{
Repo.Delete(u);
}