From f5840926a6227f1825f57bb68c9b06e725bb081b Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Wed, 14 Jun 2023 21:39:47 +0300 Subject: [PATCH] Threading always success stop without errors --- src/fw_radios.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/fw_radios.py b/src/fw_radios.py index 456287a..1e2b971 100644 --- a/src/fw_radios.py +++ b/src/fw_radios.py @@ -154,26 +154,18 @@ def radio_load(id_radio=None, type_radio='custom', name=None, related_object=Non favorite_track(player_fw_storage.storage.get( track_url_to_uuid())['id']) elif select == 'Exit': - try: - radio_event_gen.clear() - except: - logger.exception('Error stopping Thread radio generator') - pass + radio_event_gen.clear() soft_volume_reduce() player.playlist_clear() player.stop() player_fw_storage.storage = {} break - except: - try: - radio_event_gen.clear() - except: - logger.exception('Error stopping Thread radio generator') - pass + except Exception as E: + radio_event_gen.clear() player.playlist_clear() player.stop() player_fw_storage.storage = {} - logger.exception('Radio force stopped') + logger.exception(f'Radio force stopped: {E}') break