Skip to content

Commit 434a586

Browse files
committed
Do not close browser if network fails
1 parent e44a761 commit 434a586

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2021-08-18 s-n-g
22
* Version 0.8.9.7 (0.9-beta4)
33
* RadioBrowser: closing with "q" or "Escape"
4+
* RadioBrowser: do not close if network fails
45
* RadioBrowser: added hidebroken to all queries
56
* RadioBrowser: if limit=0, disable result limit
67
* RadioBrowser: finalized config save / read function

pyradio/browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ def search(self, go_back_in_history=True):
612612
except requests.exceptions.RequestException as e:
613613
if logger.isEnabledFor(logging.INFO):
614614
logger.info(e)
615-
self._raw_stations = []
615+
# self._raw_stations = []
616616
ret = False, 0, go_back_in_history
617617

618618
''' use server result '''

pyradio/radio.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,13 +3197,10 @@ def _return_from_online_browser_search(self, ret):
31973197
):
31983198
self.ws.close_window()
31993199
if not ret[0]:
3200+
logger.error('DE operation mode = {}'.format(self.ws.operation_mode))
32003201
if ret[2]:
32013202
self._goto_history_back_handler()
3202-
self._print_service_connection_error()
3203-
else:
3204-
self._cnf.remove_from_playlist_history()
3205-
self._print_service_connection_error()
3206-
self._cnf.browsing_station_service = False
3203+
self._print_service_connection_error()
32073204
return
32083205

32093206
''' get stations with online field '''
@@ -5111,7 +5108,7 @@ def keypress(self, char):
51115108
if ret == 0:
51125109
self.refreshBody()
51135110
self._set_active_stations()
5114-
self._cnf._online_browser.search()
5111+
self._cnf._online_browser.search(go_back_in_history=False)
51155112
else:
51165113
self.refreshBody()
51175114
return
@@ -5120,15 +5117,15 @@ def keypress(self, char):
51205117
# (char == ord('?') or char not in self._chars_to_bypass):
51215118
elif self.ws.operation_mode == self.ws.BROWSER_SEARCH_MODE:
51225119

5123-
''' return from browser search '''
5120+
''' handle browser search key press '''
51245121
ret = self._cnf._online_browser.keypress(char)
51255122
if ret == 0:
51265123
''' Ok, search term is valid '''
51275124
self._cnf._online_browser.get_history_from_search()
51285125
self.ws.close_window()
51295126
self.refreshBody()
51305127
self._show_performing_search_message()
5131-
self._cnf._online_browser.search()
5128+
self._cnf._online_browser.search(go_back_in_history=False)
51325129

51335130
elif ret == -1:
51345131
''' Cancel '''

0 commit comments

Comments
 (0)