mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-22 19:33:34 +02:00
search in libraries menu
This commit is contained in:
parent
f4b029630d
commit
2359ffe922
1 changed files with 8 additions and 5 deletions
|
@ -7,13 +7,13 @@ fzf = FzfPrompt()
|
|||
|
||||
|
||||
@logger.catch
|
||||
def libraries(pg=None, radio=False):
|
||||
libs_res = list_libraries(pg=pg)
|
||||
def libraries(pg=None, radio=False, search=None):
|
||||
libs_res = list_libraries(pg=pg, q=search)
|
||||
libs_count = libs_res.get('count')
|
||||
libs_next = libs_res.get('next')
|
||||
libs_prev = libs_res.get('previous')
|
||||
libs = libs_res.get('results')
|
||||
libraries_listing = []
|
||||
libraries_listing = ['Search']
|
||||
if libs_next:
|
||||
libraries_listing.append('Next')
|
||||
if libs_prev:
|
||||
|
@ -37,9 +37,12 @@ def libraries(pg=None, radio=False):
|
|||
lib_select = lib_select[0].split('.', 1)
|
||||
|
||||
if lib_select[0] == 'Next':
|
||||
return libraries(pg=libs_next)
|
||||
return libraries(pg=libs_next, search=search)
|
||||
elif lib_select[0] == 'Prev':
|
||||
return libraries(pg=libs_prev)
|
||||
return libraries(pg=libs_prev, search=search)
|
||||
elif lib_select[0] == 'Search':
|
||||
q = input('Name of library:\n')
|
||||
return libraries(search=q)
|
||||
elif lib_select[0] == 'Add remote library':
|
||||
print('Search a remote library (url\\fid):')
|
||||
new_library = federate_remote_library(input().strip())
|
||||
|
|
Loading…
Reference in a new issue