mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-05 23:03:00 +00:00
Fix next/prev page in libraries (O_o)
This commit is contained in:
parent
ae3becd1e9
commit
c232fd546b
@ -5,12 +5,13 @@ from loguru import logger
|
|||||||
fzf = FzfPrompt()
|
fzf = FzfPrompt()
|
||||||
|
|
||||||
|
|
||||||
|
@logger.catch
|
||||||
def libraries(pg=None):
|
def libraries(pg=None):
|
||||||
libs_res = list_libraries(pg=pg)
|
libs_res = list_libraries(pg=pg)
|
||||||
libs_count = libs_res.get('count')
|
libs_count = libs_res.get('count')
|
||||||
libs_next = libs_res.get('next')
|
libs_next = libs_res.get('next')
|
||||||
libs_prev = libs_res.get('previous')
|
libs_prev = libs_res.get('previous')
|
||||||
libs = list_libraries()['results']
|
libs = libs_res.get('results')
|
||||||
libraries_listing = []
|
libraries_listing = []
|
||||||
if libs_next:
|
if libs_next:
|
||||||
libraries_listing.append('Next')
|
libraries_listing.append('Next')
|
||||||
@ -24,9 +25,9 @@ def libraries(pg=None):
|
|||||||
lib_select = fzf.prompt(
|
lib_select = fzf.prompt(
|
||||||
libraries_listing, f'--header=\'found {libs_count} libraries\'')[0].split('.', 1)
|
libraries_listing, f'--header=\'found {libs_count} libraries\'')[0].split('.', 1)
|
||||||
if lib_select[0] == 'Next':
|
if lib_select[0] == 'Next':
|
||||||
libraries(pg=libs_next)
|
return libraries(pg=libs_next)
|
||||||
elif lib_select[0] == 'Prev':
|
elif lib_select[0] == 'Prev':
|
||||||
libraries(pg=libs_prev)
|
return libraries(pg=libs_prev)
|
||||||
else:
|
else:
|
||||||
lib_addr = lib_select[0]
|
lib_addr = lib_select[0]
|
||||||
lib_name = lib_select[1]
|
lib_name = lib_select[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user