mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
API List Rides Specify Since
.. To restrict to more recent rides the API for list rides will now take a parameter 'since' localhost:12021/athlete/?since=2015/02/01 Will only list rides since 1st February 2015 and can of course be used alongside 'metrics' to control what metrics are returned. localhost:12021/athlete/?since=2015/02/01&metrics=NP
This commit is contained in:
@@ -106,6 +106,15 @@ APIWebService::listAthletes(HttpRequest &request, HttpResponse &response)
|
||||
void
|
||||
APIWebService::writeRideLine(QList<int> wanted, RideItem &item, HttpRequest *request, HttpResponse *response)
|
||||
{
|
||||
|
||||
// honour the since parameter
|
||||
QString sincep(request->getParameter("since"));
|
||||
QDate since(1900,01,01);
|
||||
if (sincep != "") since = QDate::fromString(sincep,"yyyy/MM/dd");
|
||||
|
||||
// new enough ?
|
||||
if (item.dateTime.date() < since) return;
|
||||
|
||||
// date, time, filename
|
||||
response->write(item.dateTime.date().toString("yyyy/MM/dd").toLocal8Bit());
|
||||
response->write(",");
|
||||
|
||||
Reference in New Issue
Block a user