Metadata: Set time zone based on pictures taken at a similar time #914

This commit is contained in:
Michael Mayer 2021-01-19 11:41:25 +01:00
parent 9dad595c3e
commit 019a649c61

View file

@ -77,10 +77,22 @@ func (m *Photo) EstimatePlace() {
m.PlaceID = recentPhoto.PlaceID
m.PhotoCountry = recentPhoto.PhotoCountry
m.PlaceSrc = SrcEstimate
if m.TakenSrc != SrcManual {
m.TimeZone = recentPhoto.TimeZone
m.TakenAt = m.GetTakenAt()
}
log.Debugf("photo: approximate position of %s is %s (id %s)", m, txt.Quote(m.CountryName()), recentPhoto.PlaceID)
} else if recentPhoto.HasCountry() {
m.PhotoCountry = recentPhoto.PhotoCountry
m.PlaceSrc = SrcEstimate
if m.TakenSrc != SrcManual {
m.TimeZone = recentPhoto.TimeZone
m.TakenAt = m.GetTakenAt()
}
log.Debugf("photo: probable country for %s is %s", m, txt.Quote(m.CountryName()))
} else {
m.EstimateCountry()