Fix next track switch

This commit is contained in:
localhost_frssoft 2022-12-20 04:33:29 +03:00
parent 0c1a5d0887
commit b74e5ce026
2 changed files with 9 additions and 2 deletions

View file

@ -126,7 +126,11 @@ def radio_load(id_radio=None, type_radio='custom', name=None, related_object=Non
if playlist_remaining <= 2:
threading.Thread(target=radio_get_track, args=(
radio_session_id,), daemon=True).start()
player.playlist_next()
if playlist_remaining > 1:
player.playlist_next()
else:
print('No more tracks, please wait for new...')
time.sleep(3)
elif select == 'Prev':
player.playlist_prev()
elif select in ('Pause', 'Play'):

View file

@ -85,7 +85,10 @@ def player_menu(header='', storage={}):
select = fzf.prompt(player_items_menu, f"--header=\'{header}\'")[0]
if select == 'Next':
player.playlist_next()
try:
player.playlist_next()
except:
print('No more next tracks')
elif select == 'Prev':
player.playlist_prev()
elif select in ('Pause', 'Play'):