0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 13:52:00 +01:00
This commit is contained in:
KubaPro010
2025-11-06 16:00:50 +01:00
parent a04853dbfe
commit 45abb43c14

View File

@@ -8,11 +8,11 @@ class Module(PlayerModule):
def on_new_playlist(self, playlist: list[Track]): def on_new_playlist(self, playlist: list[Track]):
self.playlist = [str(t.path) for t in playlist] self.playlist = [str(t.path) for t in playlist]
def on_new_track(self, index: int, track: Track): def on_new_track(self, index: int, track: Track):
if track.path != self.playlist[index]: if track.path.name != self.playlist[index]:
# discrepancy, which means that the playing file was modified by the active modifier # discrepancy, which means that the playing file was modified by the active modifier
# we are playing a file that was not determined in the playlist, that means it was chosen by the active modifier and made up on the fly # we are playing a file that was not determined in the playlist, that means it was chosen by the active modifier and made up on the fly
lines = self.playlist[:index] + [f"> ({track.path})"] + [self.playlist[index]] + self.playlist[index+1:] lines = self.playlist[:index] + [f"> ({track.path})"] + [self.playlist[index]] + self.playlist[index+1:]
logger.info("Next up :", self.playlist[index]) # core no longer does this logger.info("Next up:", self.playlist[index]) # core no longer does this
else: else:
lines = self.playlist[:index] + [f"> {self.playlist[index]}"] + self.playlist[index+1:] lines = self.playlist[:index] + [f"> {self.playlist[index]}"] + self.playlist[index+1:]
if index + 1 < len(self.playlist): logger.info("Next up:", self.playlist[index+1]) if index + 1 < len(self.playlist): logger.info("Next up:", self.playlist[index+1])