Don't regenerate covers if present during scan (#3646)

* Don't regenerate covers if present during scan
* Fix performer unit test (unrelated)
This commit is contained in:
WithoutPants
2023-04-07 11:57:10 +10:00
committed by GitHub
parent a6ef924d06
commit 0cd0151251
3 changed files with 19 additions and 7 deletions

View File

@@ -1114,11 +1114,14 @@ func verifyPerformerAge(t *testing.T, ageCriterion models.IntCriterionInput) {
d := performer.Birthdate.Time
age := cd.Year() - d.Year()
if cd.YearDay() < d.YearDay() {
// using YearDay screws up on leap years
if cd.Month() < d.Month() || (cd.Month() == d.Month() && cd.Day() < d.Day()) {
age = age - 1
}
verifyInt(t, age, ageCriterion)
if !verifyInt(t, age, ageCriterion) {
t.Errorf("Performer birthdate: %s, deathdate: %s", performer.Birthdate.String(), performer.DeathDate.String())
}
}
return nil