Fix time difference threshold in Photo.EstimatePlace()

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-07-07 13:18:34 +02:00
parent 6273e77867
commit 3bfbd3070e

View file

@ -73,9 +73,7 @@ func (m *Photo) EstimatePlace() {
log.Errorf("photo: %s (estimate place)", err.Error())
m.EstimateCountry()
} else {
if days := recentPhoto.TakenAt.Sub(m.TakenAt) / (time.Hour * 24); days < -7 {
log.Debugf("photo: can't estimate position of %s, %d days time difference", m, -1*days)
} else if days > -7 {
if days := recentPhoto.TakenAt.Sub(m.TakenAt) / (time.Hour * 24); days < -7 || days > 7 {
log.Debugf("photo: can't estimate position of %s, %d days time difference", m, days)
} else if recentPhoto.HasPlace() {
m.Place = recentPhoto.Place