From 4efed21d3f7784fe861ee54c950e83e88e3b7b24 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 15 Jun 2023 23:53:31 +0300 Subject: [PATCH] Separate getting node info and instance settings (for fast starting) --- funkwhale_cli.py | 12 +++++------- src/fw_api.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/funkwhale_cli.py b/funkwhale_cli.py index 2bb36bf..b629c67 100755 --- a/funkwhale_cli.py +++ b/funkwhale_cli.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from src.fw_api import current_instance, get_instance_settings +from src.fw_api import current_instance, get_instance_settings, get_node_info from src.fw_radios import list_radios from src.fw_artists import list_artists from src.fw_albums import list_albums @@ -34,12 +34,9 @@ def main(): 'About instance', 'Switch instance'] try: - ins_settings, ins_nodeinfo = get_instance_settings() - for i in ins_settings: - if i.get('name') == 'support_message': - support_message = i.get('value') - if i.get('name') == 'name': - instance_title = i.get('value') + ins_nodeinfo = get_node_info() + support_message = ins_nodeinfo['metadata']['instanceSupportMessage'] + instance_title = ins_nodeinfo['metadata']['nodeName'] instance_stats = [] for k, v in ins_nodeinfo['metadata']['library'].items(): if k == 'anonymousCanListen' and v == False and not current_instance.s.headers.get('Authorization'): @@ -130,6 +127,7 @@ Insert token from "Access token" here''') if selected == 'Donate': os.system(f'less <