Skip to content
Snippets Groups Projects
Commit a03e837f authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '27-use-date-range-in-global-stats-api-call' into 'master'

Resolve "Use date range in global stats API call"

Closes #27

See merge request !19
parents 9af56b8f e725c2f6
No related branches found
No related tags found
1 merge request!19Resolve "Use date range in global stats API call"
Pipeline #4514 passed
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=0.0.17
app.versionCode=17
app.versionName=0.0.18
app.versionCode=18
Use date parameter in global stats API call.
Utilisation d'un paramètre de date dans l'appel à l'API des statistiques globales.
......@@ -9,8 +9,8 @@ import '../models/timeline.dart';
class ScrobblesApi {
static String baseUrl = 'https://scrobble.harrault.fr';
static Future<StatisticsData> fetchStatistics() async {
final String url = baseUrl + '/stats';
static Future<StatisticsData> fetchStatistics(int daysCount) async {
final String url = baseUrl + '/' + daysCount.toString() + '/stats';
print('fetching ' + url);
final response = await http.get(Uri.parse(url));
......
......@@ -12,7 +12,8 @@ class StatisticsCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
late Future<StatisticsData> futureStatistics = ScrobblesApi.fetchStatistics();
final int daysCount = 14;
late Future<StatisticsData> futureStatistics = ScrobblesApi.fetchStatistics(daysCount);
return FutureBuilder<StatisticsData>(
future: futureStatistics,
......
......@@ -3,7 +3,7 @@ description: Display scrobbles data and charts
publish_to: 'none'
version: 0.0.17+17
version: 0.0.18+18
environment:
sdk: '^3.0.0'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment