mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-23 23:19:21 +02:00
Compare commits
No commits in common. "9f37a52a642d7d20e3259e61d521f1ec259e49e1" and "88d619f304122d2f256273bfbe284924aaf6a9e4" have entirely different histories.
9f37a52a64
...
88d619f304
|
@ -45,9 +45,8 @@ def main():
|
|||
instance_title = i.get('value')
|
||||
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'):
|
||||
if k == 'anonymousCanListen' and v == False:
|
||||
instance_stats.append(f'!!! {k}: {v} !!!')
|
||||
menu = ['Switch instance', 'About instance']
|
||||
continue
|
||||
instance_stats.append(f'{k}: {v}')
|
||||
instance_stats.append(ins_nodeinfo['software']['version'])
|
||||
|
@ -55,8 +54,8 @@ def main():
|
|||
|
||||
main_menu_header = quote(f'''{instance_title}\n{instance_stats}'''.strip())
|
||||
except Exception as E:
|
||||
splitted = ':\n'.join(str(E).split(':'))
|
||||
main_menu_header = quote(f'''Connection failed:\n{splitted}'''.strip())
|
||||
time.sleep(1)
|
||||
main_menu_header = quote(f'''Connection failed: {E}'''.strip())
|
||||
menu = ['Switch instance']
|
||||
|
||||
if not current_instance.s.headers.get('Authorization'):
|
||||
|
|
|
@ -37,14 +37,13 @@ def list_albums(albums=None, pg=None, search=None, artist=None, library=None, in
|
|||
for i in albums_results:
|
||||
index = albums_results.index(i)
|
||||
album_name = i.get('title')
|
||||
album_tracks_count = i.get('tracks_count')
|
||||
option_str = f'{index}.{album_name} | {album_tracks_count}'
|
||||
option_str = f'{index}.{album_name}'
|
||||
artist_name = i.get('artist')
|
||||
if show_artist_name_in_albums and isinstance(artist_name, dict):
|
||||
artist_name = artist_name.get('name')
|
||||
option_str += f' | {artist_name}'
|
||||
option_str += f' | Artist: {artist_name}'
|
||||
view.append(f'{option_str}')
|
||||
select = fzf.prompt(view, '--header=\'map: album | tracks count | opt. artist\'')[0].split('.', 1)[0]
|
||||
select = fzf.prompt(view)[0].split('.', 1)[0]
|
||||
if select == 'Next page':
|
||||
list_albums(pg=albums_next)
|
||||
elif select == 'Prev page':
|
||||
|
|
|
@ -68,6 +68,7 @@ def get_me():
|
|||
return resp
|
||||
|
||||
|
||||
@logger.catch
|
||||
def get_instance_settings():
|
||||
r = current_instance.s.get(
|
||||
f'https://{current_instance.instance}/api/v1/instance/settings')
|
||||
|
|
Loading…
Reference in New Issue