public async Task <DeckWinrateData> Get(string shortId, bool wild) { var data = await GetData(); if (data.TryGetValue(shortId, out var deck) && !deck.IsStale) { return(deck); } if (!_cleaned) { Cleanup(); } deck = await ApiWrapper.GetDeckWinrates(shortId, wild) ?? NoDataFallback; _data[shortId] = deck; await WriteToDisk(data); return(deck); }
public async Task <DeckWinrateData> Get(string shortId, FormatType format) { if (format == FormatType.FT_CLASSIC) { return(NoDataFallback); } var data = await GetData(); if (data.TryGetValue(shortId, out var deck) && !deck.IsStale) { return(deck); } if (!_cleaned) { Cleanup(); } deck = await ApiWrapper.GetDeckWinrates(shortId, format == FormatType.FT_WILD) ?? NoDataFallback; _data[shortId] = deck; await WriteToDisk(data); return(deck); }