From c4f146fcde4bfe77b0c97415b5173d1ef2a923fb Mon Sep 17 00:00:00 2001 From: KubaPro010 <132459354+KubaPro010@users.noreply.github.com> Date: Sun, 9 Nov 2025 10:17:35 +0100 Subject: [PATCH] more prefetching --- radioPlayer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radioPlayer.py b/radioPlayer.py index e300ef8..b3192bd 100644 --- a/radioPlayer.py +++ b/radioPlayer.py @@ -197,6 +197,8 @@ def play_playlist(playlist_path: Path, starting_index: int = 0): if extend: max_iterator += 1 else: extend = False + prefetch(track.path) + logger.info(f"Now playing: {track.path.name}") for module in simple_modules: module.on_new_track(song_i, track, next_track) @@ -208,6 +210,8 @@ def play_playlist(playlist_path: Path, starting_index: int = 0): end_time = pr.started_at + ttw + if next_track: prefetch(next_track.path) + while end_time >= time.monotonic() and pr.process.poll() is None: start = time.monotonic()