Skip to content

Commit

Permalink
fix: allow to skip undesired machines
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisborn committed Nov 17, 2023
1 parent f37b9e6 commit 820f4f7
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/scripts/location_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def location_differ(
problems_links = [
entry["properties"]["external_url"] for entry in problems_old["features"]
]
skip_json, _ = load_latest_json(file="/data/skip.json")
skip_links = [
entry["properties"]["external_url"] for entry in skip_json["features"]
]

else:
with open(server_json, "r") as f:
server_data = json.load(f)
Expand Down Expand Up @@ -176,6 +181,8 @@ def location_differ(
this_address = geojson["properties"]["address"]
this_update = geojson["temporary"]["website_updated"]
match = False
if this_link in skip_links:
continue

if this_state == "unvisited":
# Check whether weblink is accessible
Expand Down
51 changes: 51 additions & 0 deletions data/skip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
4.349989,
50.844993
]
},
"properties": {
"name": "Manneken Pis",
"active": true,
"area": "Belgium",
"address": "on the corner Stoofstraat/Eikstraat, Brussels",
"status": "unvisited",
"external_url": "http://209.221.138.252/Details.aspx?location=266834",
"internal_url": "null",
"latitude": "50.844993",
"longitude": "4.349989",
"id": 6945,
"last_updated": "2023-11-17"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
4.353771399999999,
50.84664129999999
]
},
"properties": {
"name": "Belgian Souvenirs SA",
"active": true,
"area": "Belgium",
"address": "Rue de la Colline 10, Brussels (Bruxelles)",
"status": "unvisited",
"external_url": "http://209.221.138.252/Details.aspx?location=309557",
"internal_url": "null",
"latitude": "50.84664129999999",
"longitude": "4.353771399999999",
"id": 6946,
"last_updated": "2023-11-17"
}
}
]
}

0 comments on commit 820f4f7

Please sign in to comment.