From ce2fb89ccf06361d26faf4b071439b0046d74fd8 Mon Sep 17 00:00:00 2001 From: dan63047 Date: Sat, 24 Aug 2024 17:48:09 +0300 Subject: [PATCH] cache fix --- lib/data_objects/tetrio.dart | 2 ++ lib/services/tetrio_crud.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/data_objects/tetrio.dart b/lib/data_objects/tetrio.dart index 1906636..084858e 100644 --- a/lib/data_objects/tetrio.dart +++ b/lib/data_objects/tetrio.dart @@ -2644,11 +2644,13 @@ class CutoffTetrio { } class CutoffsTetrio { + late String id; late DateTime timestamp; late int total; Map data = {}; CutoffsTetrio.fromJson(Map json){ + id = json['s']; timestamp = DateTime.parse(json['t']); total = json['data']['total']; json['data'].remove("total"); diff --git a/lib/services/tetrio_crud.dart b/lib/services/tetrio_crud.dart index 1559fa4..d39419c 100644 --- a/lib/services/tetrio_crud.dart +++ b/lib/services/tetrio_crud.dart @@ -408,7 +408,7 @@ class TetrioService extends DB { // so i'm going to document only unique differences between them Future fetchCutoffsTetrio() async { - CutoffsTetrio? cached = _cache.get("", CutoffsTetrio); + CutoffsTetrio? cached = _cache.get("league_ranks", CutoffsTetrio); if (cached != null) return cached; Uri url;