Skip to content

Commit

Permalink
Fix Pats & Headpats buttons in About menu (#551)
Browse files Browse the repository at this point in the history
* fix pats

* update endpoint according to docs
  • Loading branch information
Saeraphinx authored Nov 30, 2024
1 parent b36e614 commit 75daf23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions ModAssistant/Classes/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Constants
public const string BeatModsURL = "https://beatmods.com";
public const string BeatModsVersions = "https://versions.beatmods.com/versions.json";
public const string BeatModsAlias = "https://alias.beatmods.com/aliases.json";
public const string WeebCDNAPIURL = "https://pat.assistant.moe/api/v1.0/";
public const string WeebCDNAPIURL = "https://waifu.pics/api/sfw/";
public const string BeatModsModsOptions = "mod?status=approved";
public const string MD5Spacer = " ";
public static readonly char[] IllegalCharacters = new char[]
Expand Down Expand Up @@ -60,9 +60,7 @@ public class Result

public class WeebCDNRandomResponse
{
public int index;
public string url;
public string ext;
}

public static void SendNotify(string message, string title = null)
Expand Down
6 changes: 3 additions & 3 deletions ModAssistant/Pages/About.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private async void HugsButton_Click(object sender, RoutedEventArgs e)

private async Task<string> WeebCDN(string type)
{
var resp = await HttpClient.GetAsync(Utils.Constants.WeebCDNAPIURL + type + "/random");
var resp = await HttpClient.GetAsync(Utils.Constants.WeebCDNAPIURL + type);
var body = await resp.Content.ReadAsStringAsync();

var response = JsonSerializer.Deserialize<Utils.WeebCDNRandomResponse>(body);
Expand All @@ -59,7 +59,7 @@ private async Task<bool> HeadPat()
{
try
{
var image = await WeebCDN("pats");
var image = await WeebCDN("pat");
PatImage.Load(image);

return true;
Expand All @@ -79,7 +79,7 @@ private async Task<bool> Hug()
{
try
{
var image = await WeebCDN("hugs");
var image = await WeebCDN("hug");
HugImage.Load(image);

return true;
Expand Down

0 comments on commit 75daf23

Please sign in to comment.