mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-23 04:43:33 +02:00
Fix return new instance list
This commit is contained in:
parent
ef88593f60
commit
8850ac2916
1 changed files with 13 additions and 10 deletions
|
@ -111,13 +111,16 @@ def get_new_funkwhale_servers():
|
|||
}
|
||||
]
|
||||
}
|
||||
|
||||
r = requests.post(public_server_api, json=request_public_servers)
|
||||
results = r.json()
|
||||
new_instances = []
|
||||
if results:
|
||||
new_instances_list = results['results']['A']['tables'][0]['rows']
|
||||
for i in new_instances_list:
|
||||
if i[0] not in default_conf['public_list_instances'] and i[1]:
|
||||
new_instances.append(i[0])
|
||||
return new_instances
|
||||
try:
|
||||
r = requests.post(public_server_api, json=request_public_servers)
|
||||
results = r.json()
|
||||
new_instances = []
|
||||
if results:
|
||||
new_instances_list = results['results']['A']['tables'][0]['rows']
|
||||
exists_instances = get_config('public_list_instances')
|
||||
for i in new_instances_list:
|
||||
if i[0] not in exists_instances and i[1]:
|
||||
new_instances.append(i[0])
|
||||
return new_instances
|
||||
except: # If any errors then return empty list
|
||||
return []
|
||||
|
|
Loading…
Reference in a new issue