From 820f4f78266f7df3e626009bcb591cb1557800ba Mon Sep 17 00:00:00 2001 From: jannisborn Date: Sat, 18 Nov 2023 00:49:43 +0100 Subject: [PATCH] fix: allow to skip undesired machines --- backend/scripts/location_differ.py | 7 ++++ data/skip.json | 51 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 data/skip.json diff --git a/backend/scripts/location_differ.py b/backend/scripts/location_differ.py index 3040e5a4d..374634769 100644 --- a/backend/scripts/location_differ.py +++ b/backend/scripts/location_differ.py @@ -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) @@ -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 diff --git a/data/skip.json b/data/skip.json new file mode 100644 index 000000000..d7c4fc53f --- /dev/null +++ b/data/skip.json @@ -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" + } + } + ] +} \ No newline at end of file