From 50e8a30852b079ce8b878d3acf0e66a0e696a152 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sun, 25 Jun 2023 14:58:22 +0300 Subject: [PATCH] Option for disable/enable fetching new instances --- funkwhale_cli.py | 10 +++++++--- src/settings.py | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/funkwhale_cli.py b/funkwhale_cli.py index ddf00cc..f793ed9 100755 --- a/funkwhale_cli.py +++ b/funkwhale_cli.py @@ -91,13 +91,17 @@ def main(): if selected == 'Switch instance': with open('config.json', 'rt') as f: conf = json.loads(f.read()) - public_server_list_instances = settings.get_new_funkwhale_servers() - new_ins_count = len(settings.get_new_funkwhale_servers()) + if conf.get('automatic_fetch_new_instances'): + public_server_list_instances = settings.get_new_funkwhale_servers() + new_ins_count = len(settings.get_new_funkwhale_servers()) + else: + public_server_list_instances = [] + new_ins_count = 'Disabled' list_instances = conf.get( 'public_list_instances') + public_server_list_instances settings.set_config('public_list_instances', list_instances) instance = fzf.prompt(list_instances, - '--header='+quote(f'Select instance\nServer instances: +{new_ins_count}')) + '--header='+quote(f'Select instance\nNew instances: {new_ins_count}')) if instance == []: continue else: diff --git a/src/settings.py b/src/settings.py index b06d447..f24e426 100644 --- a/src/settings.py +++ b/src/settings.py @@ -40,6 +40,7 @@ default_conf = { "funkwhale.gegeweb.eu", "shitnoise.monster" ], + 'automatic_fetch_new_instances': True, 'enable_server_transcoding': False, 'external_transcoder_http_proxy_path': "", 'track_activity_history': False,