0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-27 06:03:52 +01:00

prevent the chimer if it played last time

This commit is contained in:
2025-09-18 20:20:27 +02:00
parent c61b2b6b4d
commit 4465fdb1f7

View File

@@ -273,6 +273,7 @@ def play_playlist(playlist_path, custom_playlist: bool=False, play_newest_first=
if do_shuffle: random.shuffle(tracks) if do_shuffle: random.shuffle(tracks)
return_pending = False return_pending = False
last_chimed = False
to_fade_in = False to_fade_in = False
@@ -306,12 +307,14 @@ def play_playlist(playlist_path, custom_playlist: bool=False, play_newest_first=
pr = procman.play(track_path, to_fade_in, True) pr = procman.play(track_path, to_fade_in, True)
print_wait(pr.duration - CROSSFADE_DURATION, 1, pr.duration, f"{track_name}: ") print_wait(pr.duration - CROSSFADE_DURATION, 1, pr.duration, f"{track_name}: ")
if JINGIEL_FILE and random.choice([False, True, False, False]): if JINGIEL_FILE and random.choice([False, True, False, False]) and not last_chimed:
logger.info("Playing the jingiel") logger.info("Playing the jingiel")
procman.play(JINGIEL_FILE, False, False).process.wait() procman.play(JINGIEL_FILE, False, False).process.wait()
to_fade_in = False to_fade_in = False
last_chimed = True
else: else:
to_fade_in = True to_fade_in = True
last_chimed = False
def can_delete_file(filepath): def can_delete_file(filepath):
if not os.path.isfile(filepath): return False if not os.path.isfile(filepath): return False