Browse Source

Check if mod repo exists

tags/v1.5.0
NorbiPeti 3 years ago
parent
commit
3ef12efc9a
2 changed files with 11 additions and 2 deletions
  1. +11
    -1
      TBMM/MainModList.cs
  2. +0
    -1
      TBMM/TBMM.csproj

+ 11
- 1
TBMM/MainModList.cs View File

@@ -102,7 +102,17 @@ namespace TBMM
string repoURL = "/api/v1/repos/" + mod.Author + "/" + mod.Name + "/releases";
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 =>
{
if ((bool) rel["prerelease"] || (bool) rel["draft"])


+ 0
- 1
TBMM/TBMM.csproj View File

@@ -12,7 +12,6 @@
<Description>A mod manager for Techblox. It automatically downloads and runs GCIPA and allows the user to install mods.</Description>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<LangVersion>8</LangVersion>
<RootNamespace>GCMM</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">


Loading…
Cancel
Save