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

every 3 tracks

This commit is contained in:
2025-11-22 19:48:28 +01:00
parent 4956a3fed7
commit c40e14b7ba

View File

@@ -33,6 +33,6 @@ class Module(PlayerModule):
except Exception as e: self.logger.error(f"Failed to write play counts: {e}") except Exception as e: self.logger.error(f"Failed to write play counts: {e}")
def on_new_track(self, index: int, track: Track, next_track: Track | None) -> None: def on_new_track(self, index: int, track: Track, next_track: Track | None) -> None:
self.counts[track.path.as_posix()] = self.counts.get(track.path.as_posix(), 0) + 1 self.counts[track.path.as_posix()] = self.counts.get(track.path.as_posix(), 0) + 1
if sum(self.counts.values()) % 10 == 0: self._save_counts() if sum(self.counts.values()) % 3 == 0: self._save_counts()
module = Module() module = Module()