Skip to content

Commit c181ca5

Browse files
committed
do not stop parsing mpv reply if title is returned
1 parent a95e8e0 commit c181ca5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pyradio/player.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,7 @@ def _get_mpv_metadata(self, *args):
18711871
album, year : Album and Year of song (vorbis stations)
18721872
'''
18731873

1874+
return_value = False
18741875
a_data = args[0]
18751876
stop = args[1]
18761877
enable_crash_detection_function = args[2]
@@ -1938,7 +1939,9 @@ def _get_mpv_metadata(self, *args):
19381939
if not self.playback_is_on:
19391940
if stop():
19401941
return False
1941-
return self._set_mpv_playback_is_on(stop, enable_crash_detection_function)
1942+
return_value = self._set_mpv_playback_is_on(stop, enable_crash_detection_function)
1943+
if not return_value:
1944+
return False
19421945
else:
19431946
if (logger.isEnabledFor(logging.INFO)):
19441947
logger.info('Icy-Title is NOT valid')
@@ -1974,7 +1977,7 @@ def _get_mpv_metadata(self, *args):
19741977
with self.status_update_lock:
19751978
try:
19761979
self._icy_data[icy] = a_data.split(bytes_icy + b'":"')[1].split(b'",')[0].split(b'"}')[0].decode(enc)
1977-
except UnicodeDecodeError:
1980+
except (IndexError, UnicodeDecodeError):
19781981
pass
19791982
# logger.error('DE 0 {}'.format(self._icy_data))
19801983
# if got_icy_br:
@@ -2022,7 +2025,8 @@ def _get_mpv_metadata(self, *args):
20222025
self.info_display_handler()
20232026
return True
20242027
else:
2025-
return False
2028+
return return_value
2029+
# return False
20262030

20272031
def _set_mpv_playback_is_on(self, stop, enable_crash_detection_function):
20282032
self.stop_timeout_counter_thread = True

pyradio/radio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4070,7 +4070,7 @@ def _show_recording_status_in_header(
40704070
self.outerBodyWin.addstr(
40714071
0, 1, '──────'.encode('utf-8'), curses.color_pair(13)
40724072
)
4073-
logger.error('f{self._last_played_station = }')
4073+
logger.error(f'{self._last_played_station = }')
40744074
b_header = ''
40754075
if self.player.isPlaying():
40764076
if self.player.buffering:

0 commit comments

Comments
 (0)