fix waypoint actor in ingetrations (#1049)

This commit is contained in:
slothful-vassal
2026-06-04 20:47:16 +02:00
committed by GitHub
parent b304e9975a
commit 14ebaa0d04
2 changed files with 6 additions and 6 deletions

View File

@@ -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))
continue
}
err = createWaypointsFromTour(app, detailedTour, user, trailid)
err = createWaypointsFromTour(app, detailedTour, actor.Id, trailid)
if err != nil {
app.Logger().Warn(fmt.Sprintf("Unable to create waypoints for tour '%s': %v", tour.Name, err))
continue
@@ -358,7 +358,7 @@ func createTrailFromTour(app core.App, k *KomootApi, detailedTour *DetailedKomoo
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")
if err != nil {
return err
@@ -392,7 +392,7 @@ func createWaypointsFromTour(app core.App, tour *DetailedKomootTour, user string
"lat": wpLat,
"lon": wpLon,
"icon": "circle",
"author": user,
"author": actor,
"distance_from_start": 0,
"trail": trailid,
})

View File

@@ -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))
continue
}
err = createWaypointsFromRoute(app, route, user, trailid)
err = createWaypointsFromRoute(app, route, actor.Id, trailid)
if err != nil {
app.Logger().Warn(fmt.Sprintf("Unable to create waypoints for route '%s': %v", route.Name, err))
continue
@@ -406,7 +406,7 @@ func createTrailFromRoute(app core.App, route StravaRoute, gpx *filesystem.File,
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")
if err != nil {
return err
@@ -420,7 +420,7 @@ func createWaypointsFromRoute(app core.App, route StravaRoute, user string, trai
record.Set("lat", wp.Latlng[0])
record.Set("lon", wp.Latlng[1])
record.Set("icon", "circle")
record.Set("author", user)
record.Set("author", actor)
record.Set("distance_from_start", wp.DistanceIntoRoute)
record.Set("trail", trailid)