mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Refactor of caching & data storage part 5 #118
This commit is contained in:
@@ -15,7 +15,7 @@ class ZLOTA(FileDownloadSIGRefDataProvider):
|
||||
super().__init__(self.SIG, provider_config, self.DATA_URL, self.POLL_INTERVAL_DAYS)
|
||||
|
||||
def _http_response_to_data(self, http_response):
|
||||
new_data = {}
|
||||
new_data = []
|
||||
data = http_response.json()
|
||||
if isinstance(data, list):
|
||||
for ref in data:
|
||||
@@ -23,11 +23,12 @@ class ZLOTA(FileDownloadSIGRefDataProvider):
|
||||
latitude = ref["y"]
|
||||
longitude = ref["x"]
|
||||
|
||||
new_data[ref_id] = SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
||||
ref = SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
||||
url="https://ontheair.nz/assets/" + ref_id.replace("/", "_"),
|
||||
latitude=latitude,
|
||||
longitude=longitude)
|
||||
if latitude and longitude:
|
||||
new_data[ref_id].grid = latlong_to_locator(latitude, longitude, 6)
|
||||
ref.grid = latlong_to_locator(latitude, longitude, 6)
|
||||
new_data.append(ref)
|
||||
|
||||
return new_data
|
||||
|
||||
Reference in New Issue
Block a user