Skip to content

Commit da03bb1

Browse files
committed
Switching the active player (with \m will actually work; station
player will always prevail
1 parent bccaeed commit da03bb1

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

pyradio/radio.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,12 +2547,19 @@ def _get_the_stations_player(self, station_player):
25472547

25482548
def _what_is_the_station_player(self):
25492549
station_player = self.stations[self.selection][Station.player]
2550+
if logger.isEnabledFor(logging.DEBUG):
2551+
logger.error(f'{self._default_player_name = }')
2552+
logger.error(f'from station: {station_player = }')
25502553
if station_player == '':
25512554
station_player = self._default_player_name
2555+
if logger.isEnabledFor(logging.DEBUG):
2556+
logger.error(f'self._default_player_name = {station_player = }')
25522557
if station_player not in [x.PLAYER_NAME for x in self._cnf.AVAILABLE_PLAYERS]:
25532558
station_player = self._default_player_name
2554-
if logger.isEnabledFor(logging.DEBUG):
2555-
logger.debug(f'{station_player = }')
2559+
if logger.isEnabledFor(logging.DEBUG):
2560+
logger.error(f'self._default_player_name = {station_player = }')
2561+
if logger.isEnabledFor(logging.INFO):
2562+
logger.info(f'using {station_player = }')
25562563
return station_player
25572564

25582565
def _get_the_stations_player(self, station_player):
@@ -6617,8 +6624,8 @@ def search_radio_browser_headless(self, index):
66176624
return ''
66186625

66196626
def _activate_player(self, player_name):
6620-
if logger.isEnabledFor(logging.DEBUG):
6621-
logger.debug(f'selected player = {player_name}')
6627+
if logger.isEnabledFor(logging.INFO):
6628+
logger.info(f'activating player = {player_name}')
66226629
self._change_player = None
66236630
to_record = self.player.recording
66246631
if self.player.isPlaying():
@@ -7545,9 +7552,11 @@ def keypress(self, char):
75457552
self.refreshBody()
75467553
elif ret != '':
75477554
# set player
7548-
logger.error(f'\n\nplayer = {ret}\n\n')
75497555
self.ws.close_window()
75507556
playing = self.player.isPlaying()
7557+
self._default_player_name = ret
7558+
if logger.isEnabledFor(logging.INFO):
7559+
logger.info(f'setting {self._default_player_name = }')
75517560
self._activate_player(ret)
75527561
if playing:
75537562
self.playSelection()

0 commit comments

Comments
 (0)