From 1be8307e02278ba8c21800c792f2280c50aeed27 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 14 Aug 2023 09:59:27 +0300 Subject: [PATCH] jump by track number in player --- src/mpv_control.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mpv_control.py b/src/mpv_control.py index 2c09da3..0fd3132 100644 --- a/src/mpv_control.py +++ b/src/mpv_control.py @@ -158,7 +158,7 @@ def player_menu(header='', storage={}): while True: try: player_items_menu = ['Next', 'Prev', 'Pause', - 'Shuffle', 'Download', 'Info', 'Share'] + 'Shuffle', 'Download', 'Info', 'Share', 'Jump to'] if player.pause: player_items_menu[2] = 'Play' else: @@ -204,6 +204,10 @@ def player_menu(header='', storage={}): track_info_output(track) elif select == 'Share': send_listen_activity() + elif select == 'Jump to': + jump_to_idx = int(fzf.prompt(range(1, len(player.playlist_filenames)+1))[0]) + jump_to_idx -= 1 + player.playlist_play_index(jump_to_idx) elif select == 'Like': src.fw_api.favorite_track( player_fw_storage.storage.get(track_url_to_uuid())['id'])