escape for fzf

This commit is contained in:
localhost_frssoft 2023-06-04 13:52:50 +03:00
parent 9c940a0bac
commit 982e5f5a87
2 changed files with 4 additions and 2 deletions

View File

@ -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:

View File

@ -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()