From 984d14515abfeee890608685a25634bece84604a Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Tue, 11 Jul 2023 00:24:19 +0300 Subject: [PATCH] tracks counter in menu tracks --- src/fw_tracks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fw_tracks.py b/src/fw_tracks.py index 71d4ae8..e94e2e4 100644 --- a/src/fw_tracks.py +++ b/src/fw_tracks.py @@ -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_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 loguru import logger @@ -11,6 +11,7 @@ fzf = FzfPrompt() @logger.catch def list_tracks(pg=None, search=None, tag=None, library=None): tracks = get_tracks(q=search, pg=pg, tag=tag, library=library) + tracks_count = tracks.get('count') tracks_next = tracks.get('next') tracks_prev = tracks.get('previous') 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) track_name = i.get('title') view.append(f'{index}.{track_name}') - select = fzf.prompt(view) + select = fzf.prompt(view, f'--header=\'Found {tracks_count} tracks\'') if select == []: return else: