Refactor of caching & data storage part 17 #118

This commit is contained in:
Ian Renton
2026-08-04 22:11:34 +01:00
parent 459d999f57
commit 62b3414d29
31 changed files with 135 additions and 67 deletions
+2 -1
View File
@@ -79,11 +79,12 @@ class QRZ(APIQueryCallsignDataProvider):
qrz_response = xmltodict.parse(response.content).get("QRZDatabase", {})
if qrz_response:
if "Callsign" in qrz_response:
qrz_data = qrz_response.get("Callsign")
self.status = "OK"
self.last_update_time = datetime.now(pytz.UTC)
self.lookup_count += 1
# Found data, convert it to our object and return it
return self.qrz_response_to_callsign(callsign, qrz_response.get("Callsign"))
return self.qrz_response_to_callsign(callsign, qrz_data)
elif "Session" in qrz_response and "Error" in qrz_response.get("Session"):
# Errors here are normally just "callsign not in database", no need to log that ourselves