Skip to content

Commit

Permalink
Merge pull request #81 from Ominitay/version-fix
Browse files Browse the repository at this point in the history
Change version api url to correct and reliable one.
  • Loading branch information
geefr authored Jan 25, 2021
2 parents 28af979 + aa22ef6 commit 3ea3017
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Beataroni/Beataroni/Services/BeatModsV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ 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 = "version";
private static readonly string APIMod = "mod";
private static readonly string APIVersion = "https://versions.beatmods.com/versions.json";
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
public static IList<string> FetchBSVersions()
{
var endpoint = $"{APIRoot}/{APIVersion}";
var endpoint = $"{APIVersion}";

try
{
Expand Down Expand Up @@ -55,7 +54,7 @@ public static IList<string> FetchBSVersions()
/// Typical filters would be game version, installation type, mod status
public static IList<Mod> FetchMods( Dictionary<string, string> filters )
{
var endpoint = $"{APIRoot}/{APIMod}";
var endpoint = $"{APIMod}";

if( filters != null && filters.Count > 0 )
{
Expand Down
4 changes: 2 additions & 2 deletions tui-script/QBeat-tui
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3ea3017

Please sign in to comment.