summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ogcp/views.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index a597f75..5d08f28 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -2510,13 +2510,7 @@ def action_oglive():
return ogserver_error('commands')
oglive_list = r.json()['oglive']
-
most_used_live = max(oglives_set, key=lambda l: len(oglives_set[l]))
- default_idx = int(r.json()['default'])
- default_oglive_dir = oglive_list[default_idx].get('directory')
-
- if most_used_live == OG_CLIENT_DEFAULT_LIVEDIR:
- most_used_live = default_oglive_dir
available_oglives = []
for oglive in oglive_list:
@@ -2526,7 +2520,14 @@ def action_oglive():
else:
available_oglives.append(live_entry)
- available_oglives.append(('default', f'ogLive ({default_oglive_dir})'))
+ default_idx = int(r.json()['default'])
+ default_oglive_dir = oglive_list[default_idx].get('directory')
+ default_live_entry = ('default', f'ogLive ({default_oglive_dir})')
+
+ if most_used_live == OG_CLIENT_DEFAULT_LIVEDIR:
+ available_oglives.insert(0, default_live_entry)
+ else:
+ available_oglives.append(default_live_entry)
form.oglive.choices = available_oglives