OpenStreetmap: PlaceID now uint instead of string
API seems to have changed.
This commit is contained in:
parent
c157020dca
commit
57d5d2a183
1 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@ type openstreetmapAddress struct {
|
|||
}
|
||||
|
||||
type openstreetmapLocation struct {
|
||||
PlaceID string `json:"place_id"`
|
||||
PlaceID uint `json:"place_id"`
|
||||
Lat string `json:"lat"`
|
||||
Lon string `json:"lon"`
|
||||
Name string `json:"name"`
|
||||
|
@ -67,8 +67,8 @@ func (m *MediaFile) GetLocation() (*models.Location, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if id, err := strconv.Atoi(openstreetmapLocation.PlaceID); err == nil && id > 0 {
|
||||
location.ID = uint(id)
|
||||
if id := openstreetmapLocation.PlaceID; id > 0 {
|
||||
location.ID = id
|
||||
} else {
|
||||
return nil, errors.New("query returned no result")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue