From 5873fe78fec4e41d1472946e7520d33122df5068 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Thu, 18 Sep 2025 20:23:42 +0200 Subject: [PATCH] just use the to_fade_in, save a bit of memory --- radioPlayer.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/radioPlayer.py b/radioPlayer.py index 0e50d6b..906457e 100644 --- a/radioPlayer.py +++ b/radioPlayer.py @@ -273,7 +273,6 @@ def play_playlist(playlist_path, custom_playlist: bool=False, play_newest_first= if do_shuffle: random.shuffle(tracks) return_pending = False - last_chimed = False to_fade_in = False @@ -307,14 +306,12 @@ def play_playlist(playlist_path, custom_playlist: bool=False, play_newest_first= pr = procman.play(track_path, to_fade_in, True) print_wait(pr.duration - CROSSFADE_DURATION, 1, pr.duration, f"{track_name}: ") - if JINGIEL_FILE and random.choice([False, True, False, False]) and not last_chimed: + if JINGIEL_FILE and random.choice([False, True, False, False]) and to_fade_in: logger.info("Playing the jingiel") procman.play(JINGIEL_FILE, False, False).process.wait() to_fade_in = False - last_chimed = True else: to_fade_in = True - last_chimed = False def can_delete_file(filepath): if not os.path.isfile(filepath): return False