Skip to content

Commit

Permalink
fix: correctly remove classics and update list
Browse files Browse the repository at this point in the history
  • Loading branch information
ImRodry committed Apr 14, 2024
1 parent 8a7c895 commit 458b22b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions scripts/bikeSerialNumberMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const bikeSerialNumberMapping = {
E0065: "e2db9e6dca",
E0066: "61db8e7e4a",
E0067: "cba2966699",
C0069: "d65993b9a5",
E0069: "61a23c56a9",
E0070: "84db84b16a",
C0071: "ae5998bad5",
C0072: "61db8f6f5a",
Expand Down Expand Up @@ -114,7 +114,7 @@ const bikeSerialNumberMapping = {
E0122: "6090ecc6da",
E0123: "7d90f1869a",
E0124: "0d2e09567c",
C0125: "0cdb9f125a",
E0125: "86db9a5d9a",
E0126: "2a90e989da",
E0127: "e62e0d894c",
E0128: "0b90ef5e2a",
Expand All @@ -126,7 +126,7 @@ const bikeSerialNumberMapping = {
C0137: "3ddb8a86ea",
C0138: "f45985cde5",
E0139: "73dba2909a",
C0140: "09597b1e35",
E0140: "5da2582e89",
E0141: "7b5977a0f5",
E0142: "fa90f2f26a",
E0143: "1f90ecd9ba",
Expand All @@ -142,7 +142,7 @@ const bikeSerialNumberMapping = {
E0157: "9f5980f3b5",
E0158: "422e06563c",
E0159: "0bdb8d570a",
C0160: "4edba38cba",
E0160: "015980bd65",
E0163: "a1db9535da",
E0164: "91db8dbd7a",
E0165: "4a5477b2db",
Expand All @@ -153,7 +153,7 @@ const bikeSerialNumberMapping = {
E0171: "0f59996aa5",
E0172: "a590f3ac6a",
E0173: "aa9cf27db9",
C0174: "34db9c790a",
E0174: "1359944b95",
C0175: "e2db84b70a",
E0176: "2990f3b0fa",
E0177: "bda2950389",
Expand Down Expand Up @@ -218,6 +218,7 @@ const bikeSerialNumberMapping = {
E0243: "7914d4b801",
E0244: "09597c7955",
C0245: "c7db8fe97a",
E0247: "c5db9662ea",
E0248: "73db91033a",
C0249: "6359818e35",
C0250: "5cdb9f928a",
Expand All @@ -228,7 +229,7 @@ const bikeSerialNumberMapping = {
E0255: "28597cf8f5",
E0256: "6690e71b0a",
C0257: "d65976cc35",
C0259: "3fdb96b8ca",
E0259: "29599520c5",
E0261: "4b2e16afdc",
E0262: "c39d092e79",
C0264: "ed597908c5",
Expand Down Expand Up @@ -272,7 +273,7 @@ const bikeSerialNumberMapping = {
E0314: "12db97b4ea",
E0315: "41598f1285",
E0316: "38db8ce58a",
C0317: "eedb93bc1a",
E0317: "6b598d6ad5",
C0318: "2390d9d0ba",
C0319: "c0597ed235",
E0321: "a0f37c321d",
Expand Down Expand Up @@ -330,7 +331,7 @@ const bikeSerialNumberMapping = {
C0381: "b65982b8d5",
E0382: "5adb93889a",
C0383: "a5dba3479a",
C0384: "825998b6f5",
E0384: "64dba0657a",
E0387: "be59889af5",
E0388: "31db9c7c0a",
C0389: "0259946aa5",
Expand Down Expand Up @@ -411,9 +412,10 @@ const bikeSerialNumberMapping = {
C0488: "b6db8512fa",
E0491: "f6598a5075",
C0493: "4559825bc5",
E0494: "bbdb92a85a",
C0496: "38597dd9c5",
C0497: "2b5978fff5",
C0498: "7859889c35",
E0498: "0f2e02dffc",
C0499: "8d2e0fc06c",
E0500: "315978b5a5",
E0501: "8590f44baa",
Expand Down Expand Up @@ -884,6 +886,7 @@ const bikeSerialNumberMapping = {
E1092: "a6a2873ab9",
E1094: "d4d4b82a92",
E1095: "ffd4b48d12",
E1096: "0ad4520e82",
E1099: "f4d4520072",
E1100: "622e0ccc8c",
E1101: "3dd4593282",
Expand Down Expand Up @@ -1037,6 +1040,7 @@ const bikeSerialNumberMapping = {
E1300: "3ad4b86432",
E1301: "78d4ab7572",
E1302: "d2d4cc8842",
E1303: "38d465db52",
E1305: "8ed4c32bb2",
E1308: "3b2e05fcec",
E1309: "25d4bd5e12",
Expand Down Expand Up @@ -1186,10 +1190,12 @@ const bikeSerialNumberMapping = {
E1528: "78a2490a99",
E1529: "eca26f4869",
E1530: "49a2579529",
E1531: "21a26b6189",
E1532: "c3a266eee9",
E1535: "72a2966f29",
E1536: "c6f37d450d",
E1537: "aea27b7e09",
E1538: "4d14c9c151",
E1539: "9fa2770349",
E1543: "40a2715ac9",
E1544: "aa9d018fb9",
Expand Down
2 changes: 1 addition & 1 deletion scripts/stations.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ async function updateBikeList() {
Object.entries(bikeSerialNumberMapping)
.concat(missingBikes.map(bike => [bike.name, bike.serialNumber]))
// Keep only the electric bikes and the classic bikes that don't have an electric one with the same number
.filter(([name]) => name.startsWith("E") || !bikeSerialNumberMapping[name.replace("C", "E")])
.filter(([name], _, self) => name.startsWith("E") || !self.find(([b]) => b === name.replace("C", "E")))
.sort(([a], [b]) => Number(a.slice(1)) - Number(b.slice(1)))
);

Expand Down

0 comments on commit 458b22b

Please sign in to comment.