Fixed a timing bug found the in build. Note, when working with time differences use TotalDays.

pull/385/head
tidusjar 8 years ago
parent 694bc8aa02
commit a32599cbde

@ -115,6 +115,7 @@ namespace PlexRequests.Services.Tests
private static readonly IEnumerable<TestCaseData> DoNotResetData = new List<TestCaseData> private static readonly IEnumerable<TestCaseData> DoNotResetData = new List<TestCaseData>
{ {
new TestCaseData(1, RequestType.Movie).SetName("1 Day(s)"), new TestCaseData(1, RequestType.Movie).SetName("1 Day(s)"),
new TestCaseData(100, RequestType.Movie).SetName("100 Day(s)"),
new TestCaseData(-6, RequestType.TvShow).SetName("-6 Day(s)"), new TestCaseData(-6, RequestType.TvShow).SetName("-6 Day(s)"),
new TestCaseData(-1, RequestType.TvShow).SetName("-1 Day(s)"), new TestCaseData(-1, RequestType.TvShow).SetName("-1 Day(s)"),
new TestCaseData(-2, RequestType.Album).SetName("-2 Day(s)"), new TestCaseData(-2, RequestType.Album).SetName("-2 Day(s)"),

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

Loading…
Cancel
Save