Skip to content

Commit

Permalink
fix: remove deleted strava segment "Watopia Sprint Rev."
Browse files Browse the repository at this point in the history
  • Loading branch information
andipaetzold committed Apr 22, 2024
1 parent 0547fb8 commit 864db22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions data/segments.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ export const segments = [
slug: "watopia-sprint-rev",
type: "sprint",
world: "watopia",
stravaSegmentId: 12109228,
stravaSegmentUrl: "https://www.strava.com/segments/12109228",
whatsOnZwiftUrl:
"https://whatsonzwift.com/world/watopia/segment/sprint/reverse",
distance: 0.2,
Expand Down
6 changes: 6 additions & 0 deletions scripts/helpers/fetch-segments.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export async function fetchSegments() {
const url = `https://www.strava.com/stream/segments/${segment.stravaSegmentId}?streams%5B%5D=latlng&streams%5B%5D=distance`;
const response = await fetch(url);
const data = await response.json();
if ("error" in data) {
throw new Error(
`Error fetching segment '${segment.stravaSegmentId}'`,
data.error
);
}
return {
...segment,
latlng: data.latlng,
Expand Down
4 changes: 2 additions & 2 deletions src/segments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ export const segments: ReadonlyArray<Segment> = (
"https://whatsonzwift.com/world/watopia/segment/sprint/reverse",
"watopia-sprint-reverse",
"https://zwifterbikes.web.app/route/watopia-sprint-reverse",
12109228,
"https://www.strava.com/segments/12109228",
undefined,
undefined,
undefined,
undefined,
],
Expand Down

0 comments on commit 864db22

Please sign in to comment.