From 8b8f795f8a420c3cb7785996fb5cacb9ea5df64d Mon Sep 17 00:00:00 2001 From: Felipe Martinez Date: Mon, 3 Jun 2019 13:33:43 +0200 Subject: [PATCH] Fix U.GG provider and a crash --- .../Data/Providers/UGGProvider.cs | 29 +++++++------------ Legendary Rune Maker/Data/Rune.cs | 2 +- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Legendary Rune Maker/Data/Providers/UGGProvider.cs b/Legendary Rune Maker/Data/Providers/UGGProvider.cs index aed0db9..30c2575 100644 --- a/Legendary Rune Maker/Data/Providers/UGGProvider.cs +++ b/Legendary Rune Maker/Data/Providers/UGGProvider.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Net; using System.Text; +using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Legendary_Rune_Maker.Data.Providers @@ -21,6 +22,7 @@ internal class UGGProvider : Provider private const string UGGApiVersion = "1.1"; private const string UGGDataVersion = "1.2"; + private const string UGGOverviewVersion = "1.2.5"; private readonly static IDictionary IdToPosition = new Dictionary { @@ -36,28 +38,17 @@ private async Task GetLolUGGVersion() { if (_LolUGGVersion == null) { - var url = $"https://u.gg/json/new_ugg_versions/{UGGDataVersion}.json"; - var json = JObject.Parse(await WebCache.String(url)); - _LolUGGVersion = (json.Children().First().Next as JProperty).Name; - } - - return _LolUGGVersion; - } + var page = await WebCache.String("https://u.gg"); + var scriptUrl = Regex.Match(page, @"(?<=