mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-05-15 09:52:18 +12:00
Moved to api/v1 + Moved Broken to bottom
This commit is contained in:
parent
992480facc
commit
59cd085130
|
@ -80,7 +80,7 @@ namespace VRCMelonAssistant
|
||||||
|
|
||||||
public static async Task InstallMod(Mod mod)
|
public static async Task InstallMod(Mod mod)
|
||||||
{
|
{
|
||||||
string downloadLink = mod.versions[0].downloadlink;
|
string downloadLink = mod.versions[0].downloadLink;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(downloadLink))
|
if (string.IsNullOrEmpty(downloadLink))
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ namespace VRCMelonAssistant
|
||||||
|
|
||||||
mod.ListItem.IsInstalled = true;
|
mod.ListItem.IsInstalled = true;
|
||||||
mod.installedFilePath = targetFilePath;
|
mod.installedFilePath = targetFilePath;
|
||||||
mod.ListItem.InstalledVersion = mod.versions[0].modversion;
|
mod.ListItem.InstalledVersion = mod.versions[0].modVersion;
|
||||||
mod.ListItem.InstalledModInfo = mod;
|
mod.ListItem.InstalledModInfo = mod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace VRCMelonAssistant
|
||||||
public class Mod
|
public class Mod
|
||||||
{
|
{
|
||||||
public int _id;
|
public int _id;
|
||||||
public string uploaddate;
|
public string uploadDate;
|
||||||
public string category;
|
public string category;
|
||||||
public string[] aliases;
|
public string[] aliases;
|
||||||
public ModVersion[] versions;
|
public ModVersion[] versions;
|
||||||
|
@ -20,20 +20,20 @@ namespace VRCMelonAssistant
|
||||||
{
|
{
|
||||||
public int _version;
|
public int _version;
|
||||||
public string name;
|
public string name;
|
||||||
public string modversion;
|
public string modVersion;
|
||||||
public string modtype;
|
public string modType;
|
||||||
public string author;
|
public string author;
|
||||||
public string description;
|
public string description;
|
||||||
public string downloadlink;
|
public string downloadLink;
|
||||||
public string sourcelink;
|
public string sourceLink;
|
||||||
public string hash;
|
public string hash;
|
||||||
public string updatedate;
|
public string updateDate;
|
||||||
public string vrchatversion;
|
public string vrchatVersion;
|
||||||
public string loaderversion;
|
public string loaderVersion;
|
||||||
public int approvalStatus;
|
public int approvalStatus;
|
||||||
|
|
||||||
public bool IsBroken => approvalStatus == 2;
|
public bool IsBroken => approvalStatus == 2;
|
||||||
public bool IsPlugin => modtype.Equals("plugin", StringComparison.InvariantCultureIgnoreCase);
|
public bool IsPlugin => modType.Equals("plugin", StringComparison.InvariantCultureIgnoreCase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace VRCMelonAssistant
|
||||||
public class Constants
|
public class Constants
|
||||||
{
|
{
|
||||||
public const string VRChatAppId = "438100";
|
public const string VRChatAppId = "438100";
|
||||||
public const string VRCMGModsJson = "https://api.vrcmg.com/v0/mods.json";
|
public const string VRCMGModsJson = "https://api.vrcmg.com/v1/mods";
|
||||||
public const string WeebCDNAPIURL = "https://pat.assistant.moe/api/v1.0/";
|
public const string WeebCDNAPIURL = "https://pat.assistant.moe/api/v1.0/";
|
||||||
public const string MD5Spacer = " ";
|
public const string MD5Spacer = " ";
|
||||||
public static readonly char[] IllegalCharacters = new char[]
|
public static readonly char[] IllegalCharacters = new char[]
|
||||||
|
|
|
@ -18,9 +18,9 @@ namespace VRCMelonAssistant
|
||||||
ModDescription.Text = mod.versions[0].description ?? (string) FindResource("ModInfoWindow:NoDescription");
|
ModDescription.Text = mod.versions[0].description ?? (string) FindResource("ModInfoWindow:NoDescription");
|
||||||
ModName.Text = mod.versions[0].name;
|
ModName.Text = mod.versions[0].name;
|
||||||
ModAuthor.Text = string.Format((string) FindResource("ModInfoWindow:Author"), mod.versions[0].author ?? FindResource("ModInfoWindow:NoAuthor"));
|
ModAuthor.Text = string.Format((string) FindResource("ModInfoWindow:Author"), mod.versions[0].author ?? FindResource("ModInfoWindow:NoAuthor"));
|
||||||
ModVersion.Text = mod.versions[0].modversion;
|
ModVersion.Text = mod.versions[0].modVersion;
|
||||||
|
|
||||||
var dlLink = mod.versions[0].downloadlink;
|
var dlLink = mod.versions[0].downloadLink;
|
||||||
DownloadLink.Text = (string) FindResource("ModInfoWindow:DownloadLink");
|
DownloadLink.Text = (string) FindResource("ModInfoWindow:DownloadLink");
|
||||||
DownloadLink.Inlines.Add(new Run(" "));
|
DownloadLink.Inlines.Add(new Run(" "));
|
||||||
if (dlLink?.StartsWith("http") == true)
|
if (dlLink?.StartsWith("http") == true)
|
||||||
|
@ -28,7 +28,7 @@ namespace VRCMelonAssistant
|
||||||
else
|
else
|
||||||
DownloadLink.Inlines.Add(new Run(dlLink));
|
DownloadLink.Inlines.Add(new Run(dlLink));
|
||||||
|
|
||||||
var srcLink = mod.versions[0].sourcelink;
|
var srcLink = mod.versions[0].sourceLink;
|
||||||
SourceCodeLink.Text = (string) FindResource("ModInfoWindow:SourceCodeLink");
|
SourceCodeLink.Text = (string) FindResource("ModInfoWindow:SourceCodeLink");
|
||||||
SourceCodeLink.Inlines.Add(new Run(" "));
|
SourceCodeLink.Inlines.Add(new Run(" "));
|
||||||
if (srcLink?.StartsWith("http") == true)
|
if (srcLink?.StartsWith("http") == true)
|
||||||
|
|
|
@ -208,7 +208,7 @@ namespace VRCMelonAssistant.Pages
|
||||||
new Mod.ModVersion()
|
new Mod.ModVersion()
|
||||||
{
|
{
|
||||||
name = modInfo.ModName,
|
name = modInfo.ModName,
|
||||||
modversion = modInfo.ModVersion,
|
modVersion = modInfo.ModVersion,
|
||||||
author = modInfo.ModAuthor,
|
author = modInfo.ModAuthor,
|
||||||
description = ""
|
description = ""
|
||||||
}
|
}
|
||||||
|
@ -255,11 +255,14 @@ namespace VRCMelonAssistant.Pages
|
||||||
|
|
||||||
public async Task PopulateModsList()
|
public async Task PopulateModsList()
|
||||||
{
|
{
|
||||||
foreach (Mod mod in AllModsList)
|
foreach (Mod mod in AllModsList.Where(x => !x.versions[0].IsBroken))
|
||||||
AddModToList(mod);
|
AddModToList(mod);
|
||||||
|
|
||||||
foreach (var mod in UnknownMods)
|
foreach (var mod in UnknownMods)
|
||||||
AddModToList(mod, UnknownCategory);
|
AddModToList(mod, UnknownCategory);
|
||||||
|
|
||||||
|
foreach (Mod mod in AllModsList.Where(x => x.versions[0].IsBroken))
|
||||||
|
AddModToList(mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddModToList(Mod mod, ModListItem.CategoryInfo categoryOverride = null)
|
private void AddModToList(Mod mod, ModListItem.CategoryInfo categoryOverride = null)
|
||||||
|
@ -285,7 +288,7 @@ namespace VRCMelonAssistant.Pages
|
||||||
IsSelected = preSelected,
|
IsSelected = preSelected,
|
||||||
IsEnabled = true,
|
IsEnabled = true,
|
||||||
ModName = latestVersion.name,
|
ModName = latestVersion.name,
|
||||||
ModVersion = latestVersion.modversion,
|
ModVersion = latestVersion.modVersion,
|
||||||
ModAuthor = HardcodedCategories.FixupAuthor(latestVersion.author),
|
ModAuthor = HardcodedCategories.FixupAuthor(latestVersion.author),
|
||||||
ModDescription = latestVersion.description.Replace("\r\n", " ").Replace("\n", " "),
|
ModDescription = latestVersion.description.Replace("\r\n", " ").Replace("\n", " "),
|
||||||
ModInfo = mod,
|
ModInfo = mod,
|
||||||
|
|
Loading…
Reference in a new issue