Remove start/end dates #82

This commit is contained in:
Ian Renton
2025-11-26 07:40:46 +00:00
parent 6c9f3136b8
commit 583735c99f
2 changed files with 5 additions and 11 deletions

View File

@@ -86,10 +86,9 @@ spot-providers:
name: "39C3 TOTA"
enabled: false
url: "https://39c3.c3nav.de/"
# Start/end dates and fixed SIG/latitude/longitude for all spots are currently only a feature for the "XOTA" provider,
# the software found at https://github.com/nischu/xOTA/
start-date: "2025-12-26"
end-date: "2025-12-31"
# Fixed SIG/latitude/longitude for all spots from a provider is currently only a feature for the "XOTA" provider,
# the software found at https://github.com/nischu/xOTA/. This is because this is a generic backend for xOTA
# programmes and so different URLs provide different programmes.
sig: "TOTA"
latitude: 53.5622678
longitude: 9.9855205

View File

@@ -6,24 +6,19 @@ from spotproviders.http_spot_provider import HTTPSpotProvider
# Spot provider for servers based on the "xOTA" software at https://github.com/nischu/xOTA/
# The provider typically doesn't give us a lat/lon or SIG explicitly, so our own config provides this information. Our
# config also optionally provides a start & end date; this avoids querying the source if the xOTA event is time-limited
# and it's not currently running. This functionality is implemented for TOTA events.
# The provider typically doesn't give us a lat/lon or SIG explicitly, so our own config provides this information. This
# functionality is implemented for TOTA events.
class XOTA(HTTPSpotProvider):
POLL_INTERVAL_SEC = 300
FIXED_LATITUDE = None
FIXED_LONGITUDE = None
SIG = None
START_DATE = None
END_DATE = None
def __init__(self, provider_config):
super().__init__(provider_config, provider_config["url"] + "/api/spot/all", self.POLL_INTERVAL_SEC)
self.FIXED_LATITUDE = provider_config["latitude"] if "latitude" in provider_config else None
self.FIXED_LONGITUDE = provider_config["longitude"] if "longitude" in provider_config else None
self.SIG = provider_config["sig"] if "sig" in provider_config else None
self.START_DATE = provider_config["start-date"] if "start-date" in provider_config else None
self.END_DATE = provider_config["end-date"] if "end-date" in provider_config else None
def http_response_to_spots(self, http_response):
new_spots = []