Skip to content

Commit

Permalink
Better ride status for SixFlags parks
Browse files Browse the repository at this point in the history
Linked to issue cubehouse#180
  • Loading branch information
jeanmatthieud committed Jun 17, 2019
1 parent 99458db commit 43ba75e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/sixflags/sixflagsbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,23 @@ class SixFlagsPark extends Park {
// loop over rides
rideData.rideStatuses.forEach((ride) => {
if (rideNames[ride.rideId]) {
let rideWaitTime = undefined;
let rideStatus;
if (ride.status === 'AttractionStatusOpen') {
rideStatus = 'Operating';
rideWaitTime = parseInt(ride.waitTime, 10) || 0;
} else if (ride.status === 'AttractionStatusClosed') {
rideStatus = 'Closed';
} else if (ride.status === 'AttractionStatusTemporarilyClosed') {
rideStatus = 'Down';
} else {
this.Log('Unknown ride status for SixFlags park', ride.status);
rideStatus = 'Down';
}

this.UpdateRide(ride.rideId, {
waitTime: (ride.status === 'AttractionStatusOpen' ? (parseInt(ride.waitTime, 10) || -1) : -1),
status: rideStatus,
waitTime: rideWaitTime,
name: rideNames[ride.rideId],
});
}
Expand Down

0 comments on commit 43ba75e

Please sign in to comment.