From 230d92f399f3b3567eac63794a4b854ae85d154b Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 3 Aug 2023 11:17:43 +0300 Subject: [PATCH] remove code duplicate play_track --- src/fw_recents.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/fw_recents.py b/src/fw_recents.py index 4e75b9b..0c64702 100644 --- a/src/fw_recents.py +++ b/src/fw_recents.py @@ -1,6 +1,6 @@ from src.fw_api import get_favorires_tracks, get_recently_listened, get_audio_file from src.fw_api_hints import hint_scope -from src.mpv_control import player, player_menu, track_url_to_uuid, player_fw_storage +from src.mpv_control import player, player_menu, track_url_to_uuid, player_fw_storage, play_track from pyfzf.pyfzf import FzfPrompt from loguru import logger @@ -54,14 +54,3 @@ def list_fav_or_history(pg=None, search=None, scope=None, is_history_view=False) else: play_track(track=tracks_results[int( select[0].split('.', 1)[0])]['track']) - - -def play_track(track, multi=False): - listen_url = get_audio_file(track['listen_url'], True) - player_fw_storage.storage[track_url_to_uuid(listen_url)] = track - if multi: - player.loadfile(listen_url, 'append-play') - else: - player.loadfile(listen_url, 'append-play') - track_name = track.get('title') - player_menu(f"{track_name} playing...", player_fw_storage.storage)