From 800b8353b0595d6caa140959715343bb81bef414 Mon Sep 17 00:00:00 2001 From: Ominitay <37453713+Ominitay@users.noreply.github.com> Date: Mon, 25 Jan 2021 00:39:26 +0000 Subject: [PATCH 1/2] Change version api url to correct and reliable one. --- Beataroni/Beataroni/Services/BeatModsV1.cs | 4 ++-- tui-script/QBeat-tui | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Beataroni/Beataroni/Services/BeatModsV1.cs b/Beataroni/Beataroni/Services/BeatModsV1.cs index 987dff4..642b9e0 100644 --- a/Beataroni/Beataroni/Services/BeatModsV1.cs +++ b/Beataroni/Beataroni/Services/BeatModsV1.cs @@ -19,14 +19,14 @@ public class BeatModsV1 /// Note: You MUST not have '//' in the resulting URLs, beatmods can't handle this private static readonly string APIRoot = "https://beatmods.com/api/v1"; private static readonly string APIDownload = "https://beatmods.com"; - private static readonly string APIVersion = "version"; + private static readonly string APIVersion = "https://versions.beatmods.com/versions.json"; private static readonly string APIMod = "mod"; /// Fetch list of beatsaber/mod versions /// List will be returned in order sent from server - Should be newest -> oldest public static IList FetchBSVersions() { - var endpoint = $"{APIRoot}/{APIVersion}"; + var endpoint = $"{APIVersion}"; try { diff --git a/tui-script/QBeat-tui b/tui-script/QBeat-tui index e9941b7..199de1c 100755 --- a/tui-script/QBeat-tui +++ b/tui-script/QBeat-tui @@ -504,7 +504,7 @@ function action-installer-set-config { function action-installer-set-version { # Sets version as part of first-time setup, similarly to action-version-set. - versionsarray=( $( curl -sL https://beatmods.com/api/v1/version | sed -e 's/\[//' -e 's/\]//' -e 's/,/\n/g' ) ) + versionsarray=( $( curl -sL https://versions.beatmods.com/versions.json | sed -e 's/\[//' -e 's/\]//' -e 's/,/\n/g' ) ) echo "Default: ${versionsarray[0]//\"/}" echo "Select a version:" @@ -803,7 +803,7 @@ EOF ${scriptpath}/QBeat --config get gameVersion echo "-----------------------------" - versionsarray=( $( curl -sL https://beatmods.com/api/v1/version | sed -e 's/\[//' -e 's/\]//' -e 's/,/\n/g' ) ) + versionsarray=( $( curl -sL https://versions.beatmods.com/versions | sed -e 's/\[//' -e 's/\]//' -e 's/,/\n/g' ) ) echo " Select a version:" for i in ${!versionsarray[@]} do From aa22ef6a516ed37bb8f0179fadea006985fce96c Mon Sep 17 00:00:00 2001 From: Ominitay <37453713+Ominitay@users.noreply.github.com> Date: Mon, 25 Jan 2021 01:03:31 +0000 Subject: [PATCH 2/2] Remove APIRoot variable --- Beataroni/Beataroni/Services/BeatModsV1.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Beataroni/Beataroni/Services/BeatModsV1.cs b/Beataroni/Beataroni/Services/BeatModsV1.cs index 642b9e0..f799c32 100644 --- a/Beataroni/Beataroni/Services/BeatModsV1.cs +++ b/Beataroni/Beataroni/Services/BeatModsV1.cs @@ -17,10 +17,9 @@ public class BeatModsV1 /// API endpoints/urls /// Note: You MUST not have '//' in the resulting URLs, beatmods can't handle this - private static readonly string APIRoot = "https://beatmods.com/api/v1"; private static readonly string APIDownload = "https://beatmods.com"; private static readonly string APIVersion = "https://versions.beatmods.com/versions.json"; - private static readonly string APIMod = "mod"; + private static readonly string APIMod = "https://beatmods.com/api/v1/mod"; /// Fetch list of beatsaber/mod versions /// List will be returned in order sent from server - Should be newest -> oldest @@ -55,7 +54,7 @@ public static IList FetchBSVersions() /// Typical filters would be game version, installation type, mod status public static IList FetchMods( Dictionary filters ) { - var endpoint = $"{APIRoot}/{APIMod}"; + var endpoint = $"{APIMod}"; if( filters != null && filters.Count > 0 ) {