fix waypoint actor in ingetrations (#1049)
This commit is contained in:
@@ -228,7 +228,7 @@ func syncTrailWithTours(app core.App, client meilisearch.ServiceManager, ctx con
|
|||||||
app.Logger().Warn(fmt.Sprintf("Unable to create trail for tour '%s': %v", tour.Name, err))
|
app.Logger().Warn(fmt.Sprintf("Unable to create trail for tour '%s': %v", tour.Name, err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err = createWaypointsFromTour(app, detailedTour, user, trailid)
|
err = createWaypointsFromTour(app, detailedTour, actor.Id, trailid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.Logger().Warn(fmt.Sprintf("Unable to create waypoints for tour '%s': %v", tour.Name, err))
|
app.Logger().Warn(fmt.Sprintf("Unable to create waypoints for tour '%s': %v", tour.Name, err))
|
||||||
continue
|
continue
|
||||||
@@ -358,7 +358,7 @@ func createTrailFromTour(app core.App, k *KomootApi, detailedTour *DetailedKomoo
|
|||||||
return trailid, nil
|
return trailid, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func createWaypointsFromTour(app core.App, tour *DetailedKomootTour, user string, trailid string) error {
|
func createWaypointsFromTour(app core.App, tour *DetailedKomootTour, actor string, trailid string) error {
|
||||||
collection, err := app.FindCollectionByNameOrId("waypoints")
|
collection, err := app.FindCollectionByNameOrId("waypoints")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -392,7 +392,7 @@ func createWaypointsFromTour(app core.App, tour *DetailedKomootTour, user string
|
|||||||
"lat": wpLat,
|
"lat": wpLat,
|
||||||
"lon": wpLon,
|
"lon": wpLon,
|
||||||
"icon": "circle",
|
"icon": "circle",
|
||||||
"author": user,
|
"author": actor,
|
||||||
"distance_from_start": 0,
|
"distance_from_start": 0,
|
||||||
"trail": trailid,
|
"trail": trailid,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ func syncTrailsWithRoutes(app core.App, client meilisearch.ServiceManager, ctx c
|
|||||||
app.Logger().Warn(fmt.Sprintf("Unable to create trail for route '%s': %v", route.Name, err))
|
app.Logger().Warn(fmt.Sprintf("Unable to create trail for route '%s': %v", route.Name, err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err = createWaypointsFromRoute(app, route, user, trailid)
|
err = createWaypointsFromRoute(app, route, actor.Id, trailid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.Logger().Warn(fmt.Sprintf("Unable to create waypoints for route '%s': %v", route.Name, err))
|
app.Logger().Warn(fmt.Sprintf("Unable to create waypoints for route '%s': %v", route.Name, err))
|
||||||
continue
|
continue
|
||||||
@@ -406,7 +406,7 @@ func createTrailFromRoute(app core.App, route StravaRoute, gpx *filesystem.File,
|
|||||||
return trailid, err
|
return trailid, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func createWaypointsFromRoute(app core.App, route StravaRoute, user string, trailid string) error {
|
func createWaypointsFromRoute(app core.App, route StravaRoute, actor string, trailid string) error {
|
||||||
collection, err := app.FindCollectionByNameOrId("waypoints")
|
collection, err := app.FindCollectionByNameOrId("waypoints")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -420,7 +420,7 @@ func createWaypointsFromRoute(app core.App, route StravaRoute, user string, trai
|
|||||||
record.Set("lat", wp.Latlng[0])
|
record.Set("lat", wp.Latlng[0])
|
||||||
record.Set("lon", wp.Latlng[1])
|
record.Set("lon", wp.Latlng[1])
|
||||||
record.Set("icon", "circle")
|
record.Set("icon", "circle")
|
||||||
record.Set("author", user)
|
record.Set("author", actor)
|
||||||
record.Set("distance_from_start", wp.DistanceIntoRoute)
|
record.Set("distance_from_start", wp.DistanceIntoRoute)
|
||||||
record.Set("trail", trailid)
|
record.Set("trail", trailid)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user