1.0-dev16 (GUI code cleaning, media not found exception handling added)

This commit is contained in:
2022-03-09 23:43:51 +01:00
Unverified
parent 51389c4df1
commit b4347f2b5c
40 changed files with 1312 additions and 1412 deletions

View File

@@ -49,7 +49,9 @@ namespace VDownload.Core.Services.Sources.Twitch
using (WebClient client = await Client.Helix())
{
client.QueryString.Add("login", ID);
response = JObject.Parse(await client.DownloadStringTaskAsync("https://api.twitch.tv/helix/users"))["data"][0];
response = JObject.Parse(await client.DownloadStringTaskAsync("https://api.twitch.tv/helix/users"))["data"];
if (((JArray)response).Count > 0) response = response[0];
else throw new MediaNotFoundException($"Twitch Channel (ID: {ID}) was not found");
}
// Create unified playlist url