Skip to content

Commit

Permalink
Improves code for PortAventura (cubehouse#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmatthieud committed Jul 23, 2021
1 parent 1cb50d0 commit 7fae752
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/portaventura/portaventura.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ class PortAventura extends Park {
}).then((rides) => {
rides.forEach((ride) => {
// parse wait time
// ride.time_range or ride.time_sign / tolerencia ?
// const parsedTime = /([-\d]+)(?::(\d+))?/.exec(ride.tiempo_espera);
// let waitTime = null;
// if (parsedTime[1] !== '-1' && parsedTime[2] !== undefined) {
// waitTime = (Number(parsedTime[1]) * 60) + Number(parsedTime[2]);
// }
let waitTime = null;
if (ride.location_status === 0) { // TODO : find the location_status when a ride is not operational
// TODO: find the location_status when a ride is not operational
if (ride.location_status === 0) {
waitTime = -1;
} else {
// TODO: parse waiting time (ride.time_range or ride.time_sign)?
// const parsedTime = /([-\d]+)(?::(\d+))?/.exec(ride.tiempo_espera);
// if (parsedTime[1] !== '-1' && parsedTime[2] !== undefined) {
// waitTime = (Number(parsedTime[1]) * 60) + Number(parsedTime[2]);
// }
}

// update ride object
Expand Down

0 comments on commit 7fae752

Please sign in to comment.