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

Pull Stable Names and Presets Directly From Github #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 4 additions & 8 deletions randobot/zsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class ZSR:
details_endpoint = 'https://ootrandomizer.com/api/v2/seed/details'
password_endpoint = 'https://ootrandomizer.com/api/v2/seed/pw'
version_endpoint = 'https://ootrandomizer.com/api/version'
preset_endpoint = 'https://ootrandomizer.com/rtgg/ootr_presets.json'
preset_dev_endpoint = 'https://ootrandomizer.com/rtgg/ootr_presets_dev.json'
settings_endpoint = 'https://raw.githubusercontent.com/TestRunnerSRL/OoT-Randomizer/release/data/presets_default.json'
settings_dev_endpoint = 'https://raw.githubusercontent.com/TestRunnerSRL/OoT-Randomizer/Dev/data/presets_default.json'
qualifier_placement_endpoint = 'https://ootrandomizer.com/tournament/seedsOnly'
Expand Down Expand Up @@ -74,15 +72,13 @@ def load_presets(self):
"""
Load and return available seed presets.
"""
presets = requests.get(self.preset_endpoint).json()
settings = requests.get(self.settings_endpoint).json()
return {
key: {
'full_name': value['fullName'],
'settings': settings.get(value['fullName']),
min(settings[preset]['aliases'], key=len): {
'full_name': preset,
'settings': settings.get(preset),
}
for key, value in presets.items()
if value['fullName'] in settings
for preset in settings
}

def load_presets_dev(self):
Expand Down