Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change version api url to correct and reliable one. #81

Merged
merged 2 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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