From 982e5f5a877f9bc3dde5d9ef5dfedc934ac8ab8b Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sun, 4 Jun 2023 13:52:50 +0300 Subject: [PATCH] escape for fzf --- src/fw_radios.py | 3 ++- src/mpv_control.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fw_radios.py b/src/fw_radios.py index 3ac9f4e..ba2c95d 100644 --- a/src/fw_radios.py +++ b/src/fw_radios.py @@ -6,6 +6,7 @@ from src.mpv_control import player, track_url_to_uuid, player_fw_storage from src.settings import get_config from pyfzf.pyfzf import FzfPrompt from loguru import logger +from shlex import quote import threading import time import sys @@ -121,7 +122,7 @@ def radio_load(id_radio=None, type_radio='custom', name=None, related_object=Non else: player_items_menu[2] = 'Pause' select = fzf.prompt(player_items_menu, - f"--header=\'Radio {name} playing...\'")[0] + quote(f"--header=\'Radio {name} playing...\'"))[0] if select == 'Next': playlist_remaining = player.playlist_count - player.playlist_current_pos if playlist_remaining <= 2: diff --git a/src/mpv_control.py b/src/mpv_control.py index da4d0c2..0791b51 100644 --- a/src/mpv_control.py +++ b/src/mpv_control.py @@ -4,6 +4,7 @@ from src.settings import get_config from loguru import logger from pyfzf.pyfzf import FzfPrompt from shutil import get_terminal_size +from shlex import quote import mpv import time import sys @@ -129,7 +130,7 @@ def player_menu(header='', storage={}): player_items_menu.append('Like') player_items_menu.extend(['Hide artist', 'Exit']) - select = fzf.prompt(player_items_menu, f"--header=\'{header}\'")[0] + select = fzf.prompt(player_items_menu, quote(f"--header=\'{header}\'"))[0] if select == 'Next': try: player.playlist_next()