From c93a2f0ee5b41fd5bf7998506feb948a69e13e64 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Wed, 14 Jun 2023 18:34:26 +0300 Subject: [PATCH] Libraries menu changed --- src/fw_libraries.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fw_libraries.py b/src/fw_libraries.py index 7189985..8dd9ce8 100644 --- a/src/fw_libraries.py +++ b/src/fw_libraries.py @@ -1,4 +1,4 @@ -from src.fw_api import list_libraries, federate_remote_library, scan_remote_library +from src.fw_api import current_instance, list_libraries, federate_remote_library, scan_remote_library from pyfzf.pyfzf import FzfPrompt from loguru import logger import time @@ -18,16 +18,18 @@ def libraries(pg=None, radio=False): libraries_listing.append('Next') if libs_prev: libraries_listing.append('Prev') - if radio == False: + if current_instance.s.headers.get('Authorization'): libraries_listing.append('Add remote library') for lib_i in libs: index = libs.index(lib_i) lib_name = lib_i.get('name') + lib_tracks_count = lib_i.get('uploads_count') lib_by = lib_i.get('actor').get('full_username') - libraries_listing.append(f'{index}.{lib_name} | by {lib_by}') + libraries_listing.append(f'{index}.{lib_name} | {lib_by} | {lib_tracks_count}') lib_select = fzf.prompt( - libraries_listing, f'--header=\'found {libs_count} libraries\'')[0].split('.', 1) + libraries_listing, + f'--header=\'found {libs_count} libraries\nmap: library name | owner | tracks count\'')[0].split('.', 1) if lib_select[0] == 'Next': return libraries(pg=libs_next) elif lib_select[0] == 'Prev': @@ -61,4 +63,3 @@ def libraries(pg=None, radio=False): return None, 'library', f'{lib_name}\n{lib_fid}', lib_uuid else: return lib_uuid -