Backend: Set PlaceID and PhotoCountry for unknown locations

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-04-26 17:06:40 +02:00
parent 65f47a5db4
commit 404682b730

View file

@ -236,13 +236,10 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) (
}
}
if photo.Place == nil {
if len(photo.PlaceID) < 2 {
photo.Place = &entity.UnknownPlace
photo.PlaceID = entity.UnknownPlace.ID
}
if photo.PhotoCountry == "" || photo.PhotoCountry == "zz" {
photo.PhotoCountry = photo.Place.LocCountry
photo.PhotoCountry = entity.UnknownPlace.CountryCode()
}
if !photo.TakenAtLocal.IsZero() {