You've already forked RadioPlayer
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:
@@ -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:]
|
||||
|
||||
Reference in New Issue
Block a user