Commit 0c76e62b authored by Volker Krause's avatar Volker Krause
Browse files

Fetch GBFS version, vehicle types and geofencing zone data if available

parent 21fd201a
......@@ -21,6 +21,9 @@ struct {
{ "station_information" },
{ "station_status" },
{ "free_bike_status" },
{ "gbfs_versions" },
{ "vehicle_types" },
{ "geofencing_zones" },
};
static_assert((sizeof(file_info_map) / sizeof(file_info_map[0])) == GBFS::Unknown, "");
......
......@@ -23,6 +23,9 @@ namespace GBFS
StationInformation,
StationStatus,
FreeBikeStatus,
Versions,
VehicleTypes,
GeofencingZones,
Unknown, // keep last
};
......
......@@ -138,6 +138,9 @@ void GBFSJob::parseDiscoverData(bool sysInfoOnly)
case GBFS::StationInformation:
case GBFS::StationStatus:
case GBFS::FreeBikeStatus:
case GBFS::Versions:
case GBFS::VehicleTypes:
case GBFS::GeofencingZones:
if (!m_store.hasCurrentData(type)) {
qDebug() << "fetching" << name;
auto reply = m_nam->get(QNetworkRequest(url));
......
......@@ -28,7 +28,10 @@ struct {
{ std::chrono::hours(24 * 5) },
{ std::chrono::hours(24 * 5) },
{ std::chrono::minutes(5) },
{ std::chrono::minutes(5) }
{ std::chrono::minutes(5) },
{ std::chrono::hours(24 * 5) },
{ std::chrono::hours(24 * 5) },
{ std::chrono::hours(24 * 5) },
};
static_assert((sizeof(file_ttl_map) / sizeof(file_ttl_map[0])) == GBFS::Unknown, "");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment