mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-22 05:39:48 +00:00
reduce visual overhead in recents/liked menu
This commit is contained in:
parent
d39a86a2a9
commit
f401700e78
@ -9,10 +9,10 @@ fzf = FzfPrompt()
|
|||||||
@logger.catch
|
@logger.catch
|
||||||
def list_fav_or_history(pg=None, search=None, scope=None, is_history_view=False):
|
def list_fav_or_history(pg=None, search=None, scope=None, is_history_view=False):
|
||||||
if is_history_view:
|
if is_history_view:
|
||||||
caption = 'listened:'
|
action = 'listened'
|
||||||
tracks = get_recently_listened(q=search, scope=scope, pg=pg)
|
tracks = get_recently_listened(q=search, scope=scope, pg=pg)
|
||||||
else:
|
else:
|
||||||
caption = 'liked:'
|
action = 'liked'
|
||||||
tracks = get_favorires_tracks(q=search, scope=scope, pg=pg)
|
tracks = get_favorires_tracks(q=search, scope=scope, pg=pg)
|
||||||
tracks_next = tracks.get('next')
|
tracks_next = tracks.get('next')
|
||||||
tracks_prev = tracks.get('previous')
|
tracks_prev = tracks.get('previous')
|
||||||
@ -27,8 +27,8 @@ def list_fav_or_history(pg=None, search=None, scope=None, is_history_view=False)
|
|||||||
index = tracks_results.index(i)
|
index = tracks_results.index(i)
|
||||||
track_name = i['track'].get('title')
|
track_name = i['track'].get('title')
|
||||||
who_user = i['user'].get('username')
|
who_user = i['user'].get('username')
|
||||||
view.append(f'{index}.{track_name} | {caption} {who_user}')
|
view.append(f'{index}.{track_name} | {who_user}')
|
||||||
select = fzf.prompt(view, '--multi')
|
select = fzf.prompt(view, f'--multi --header=\'map: track title | who {action}\'')
|
||||||
if 'Next page' in select:
|
if 'Next page' in select:
|
||||||
list_fav_or_history(pg=tracks_next, is_history_view=is_history_view)
|
list_fav_or_history(pg=tracks_next, is_history_view=is_history_view)
|
||||||
elif 'Prev page' in select:
|
elif 'Prev page' in select:
|
||||||
|
Loading…
Reference in New Issue
Block a user