mirror of
http://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-21 21:51:28 +00:00
Now dump new instances in config
This commit is contained in:
parent
982e5f5a87
commit
11dba2648d
|
@ -83,6 +83,7 @@ def main():
|
|||
new_ins_count = len(settings.get_new_funkwhale_servers())
|
||||
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}'))[0]
|
||||
current_instance.select_instance(instance)
|
||||
|
|
|
@ -90,6 +90,13 @@ def get_config(key):
|
|||
return loaded_config.get(key)
|
||||
|
||||
|
||||
def set_config(key, value):
|
||||
'''set value new value config by key'''
|
||||
read_conf = check_config()
|
||||
with open(conf_file, 'wt') as f:
|
||||
read_conf[key] = value
|
||||
f.write(json.dumps(read_conf, indent=4))
|
||||
|
||||
@logger.catch
|
||||
def get_new_funkwhale_servers():
|
||||
# Uses official API network.funkwhale.audio for getting new instances
|
||||
|
|
Loading…
Reference in a new issue