diff --git a/modules/active_modifier.py b/modules/active_modifier.py index 9c98b04..a73f23d 100644 --- a/modules/active_modifier.py +++ b/modules/active_modifier.py @@ -5,7 +5,7 @@ class ActiveModifier: """Tuple consists of the track path, to fade out, fade in, official, and args""" def play(self, index: int, track: tuple[str, bool, bool, bool, dict[str, str]]): return track def on_new_playlist(self, playlist: list[tuple[str, bool, bool, bool, dict[str, str]]]): pass - +import os class Module(ActiveModifier): def __init__(self) -> None: self.playlist = None @@ -14,6 +14,7 @@ class Module(ActiveModifier): self.playlist = playlist def play(self, index: int, track: tuple[str, bool, bool, bool, dict[str, str]]): if not self.playlist: return track + if not os.path.exists("/tmp/radioPlayer_toplay"): open("/tmp/radioPlayer_toplay", "a").close() with open("/tmp/radioPlayer_toplay", "r") as f: songs = [s.strip() for s in f.readlines() if s.strip()] if len(songs): @@ -34,4 +35,6 @@ class Module(ActiveModifier): return song, last_track_to_fade_out, next_track_to_fade_in, True, {} elif len(self.originals): - return self.originals.pop(0) \ No newline at end of file + return self.originals.pop(0) + +activemod = Module() \ No newline at end of file