From 38222b98c85cae01f2bac950f53dcd6509a8e282 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sun, 19 Oct 2025 14:28:33 +0100 Subject: [PATCH] Remove tags from comments. Closes #46 --- data/spot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/spot.py b/data/spot.py index 07cc16a..7022c24 100644 --- a/data/spot.py +++ b/data/spot.py @@ -2,6 +2,7 @@ import copy import hashlib import json import logging +import re from dataclasses import dataclass from datetime import datetime @@ -234,6 +235,13 @@ class Spot: if self.comment and not self.qrt: self.qrt = "QRT" in self.comment.upper() + # Clean up comments + if self.comment: + comment = re.sub(r"\[.*]:", "", self.comment) + comment = re.sub(r"\[.*]", "", comment) + comment = re.sub(r"\"\"", "", comment) + self.comment = comment.strip() + # DX operator details lookup, using QRZ.com. This should be the last resort compared to taking the data from # the actual spotting service, e.g. we don't want to accidentally use a user's QRZ.com home lat/lon instead of # the one from the park reference they're at.