mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-22 18:19:20 +02:00
tracks counter in menu tracks
This commit is contained in:
parent
1d6e63e9e9
commit
984d14515a
|
@ -1,7 +1,7 @@
|
||||||
from src.fw_api import get_tracks, get_audio_file
|
from src.fw_api import get_tracks
|
||||||
from src.fw_tags import list_tags
|
from src.fw_tags import list_tags
|
||||||
from src.fw_libraries import libraries
|
from src.fw_libraries import libraries
|
||||||
from src.mpv_control import player, player_menu, track_url_to_uuid, play_track
|
from src.mpv_control import play_track
|
||||||
from pyfzf.pyfzf import FzfPrompt
|
from pyfzf.pyfzf import FzfPrompt
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ fzf = FzfPrompt()
|
||||||
@logger.catch
|
@logger.catch
|
||||||
def list_tracks(pg=None, search=None, tag=None, library=None):
|
def list_tracks(pg=None, search=None, tag=None, library=None):
|
||||||
tracks = get_tracks(q=search, pg=pg, tag=tag, library=library)
|
tracks = get_tracks(q=search, pg=pg, tag=tag, library=library)
|
||||||
|
tracks_count = tracks.get('count')
|
||||||
tracks_next = tracks.get('next')
|
tracks_next = tracks.get('next')
|
||||||
tracks_prev = tracks.get('previous')
|
tracks_prev = tracks.get('previous')
|
||||||
tracks_results = tracks.get('results')
|
tracks_results = tracks.get('results')
|
||||||
|
@ -24,7 +25,7 @@ def list_tracks(pg=None, search=None, tag=None, library=None):
|
||||||
index = tracks_results.index(i)
|
index = tracks_results.index(i)
|
||||||
track_name = i.get('title')
|
track_name = i.get('title')
|
||||||
view.append(f'{index}.{track_name}')
|
view.append(f'{index}.{track_name}')
|
||||||
select = fzf.prompt(view)
|
select = fzf.prompt(view, f'--header=\'Found {tracks_count} tracks\'')
|
||||||
if select == []:
|
if select == []:
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue