0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 21:53:54 +01:00

modularize playlist change

This commit is contained in:
Kuba
2025-10-11 17:29:56 +02:00
parent e7219c5770
commit cf4f3137bd
5 changed files with 46 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
class PlayerModule:
def on_new_playlist(self, playlist: list[tuple[str, bool, bool, bool]]):
def on_new_playlist(self, playlist: list[tuple[str, bool, bool, bool, dict]]):
pass
def on_new_track(self, index: int, track: str, to_fade_in: bool, to_fade_out: bool, official: bool):
pass
@@ -7,7 +7,7 @@ class PlayerModule:
class Module(PlayerModule):
def __init__(self) -> None:
self.playlist = []
def on_new_playlist(self, playlist: list[tuple[str, bool, bool, bool]]):
def on_new_playlist(self, playlist: list[tuple[str, bool, bool, bool, dict]]):
self.playlist = [t[0] for t in playlist]
def on_new_track(self, index: int, track: str, to_fade_in: bool, to_fade_out: bool, official: bool):
lines = self.playlist[:index] + [f"> {self.playlist[index]}"] + self.playlist[index+1:]