Check if mod repo exists
This commit is contained in:
parent
c0bbd97953
commit
3ef12efc9a
2 changed files with 11 additions and 2 deletions
|
@ -102,7 +102,17 @@ namespace TBMM
|
||||||
string repoURL = "/api/v1/repos/" + mod.Author + "/" + mod.Name + "/releases";
|
string repoURL = "/api/v1/repos/" + mod.Author + "/" + mod.Name + "/releases";
|
||||||
using (var client = GetClient())
|
using (var client = GetClient())
|
||||||
{
|
{
|
||||||
var arr = JArray.Parse(await client.DownloadStringTaskAsync(repoURL));
|
string str;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
str = await client.DownloadStringTaskAsync(repoURL);
|
||||||
|
}
|
||||||
|
catch (WebException)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var arr = JArray.Parse(str);
|
||||||
var release = arr.FirstOrDefault(rel =>
|
var release = arr.FirstOrDefault(rel =>
|
||||||
{
|
{
|
||||||
if ((bool) rel["prerelease"] || (bool) rel["draft"])
|
if ((bool) rel["prerelease"] || (bool) rel["draft"])
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
<Description>A mod manager for Techblox. It automatically downloads and runs GCIPA and allows the user to install mods.</Description>
|
<Description>A mod manager for Techblox. It automatically downloads and runs GCIPA and allows the user to install mods.</Description>
|
||||||
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
|
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
|
||||||
<LangVersion>8</LangVersion>
|
<LangVersion>8</LangVersion>
|
||||||
<RootNamespace>GCMM</RootNamespace>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|
Loading…
Reference in a new issue