cache fix

This commit is contained in:
dan63047 2024-08-24 17:48:09 +03:00
parent 7cb1fc0543
commit ce2fb89ccf
2 changed files with 3 additions and 1 deletions

View File

@ -2644,11 +2644,13 @@ class CutoffTetrio {
} }
class CutoffsTetrio { class CutoffsTetrio {
late String id;
late DateTime timestamp; late DateTime timestamp;
late int total; late int total;
Map<String, CutoffTetrio> data = {}; Map<String, CutoffTetrio> data = {};
CutoffsTetrio.fromJson(Map<String, dynamic> json){ CutoffsTetrio.fromJson(Map<String, dynamic> json){
id = json['s'];
timestamp = DateTime.parse(json['t']); timestamp = DateTime.parse(json['t']);
total = json['data']['total']; total = json['data']['total'];
json['data'].remove("total"); json['data'].remove("total");

View File

@ -408,7 +408,7 @@ class TetrioService extends DB {
// so i'm going to document only unique differences between them // so i'm going to document only unique differences between them
Future<CutoffsTetrio?> fetchCutoffsTetrio() async { Future<CutoffsTetrio?> fetchCutoffsTetrio() async {
CutoffsTetrio? cached = _cache.get("", CutoffsTetrio); CutoffsTetrio? cached = _cache.get("league_ranks", CutoffsTetrio);
if (cached != null) return cached; if (cached != null) return cached;
Uri url; Uri url;