save every play

This commit is contained in:
2025-12-02 16:34:58 +01:00
parent 5e0bc2c99c
commit 75802ccef4
+1 -1
View File
@@ -33,7 +33,7 @@ class Module(PlayerModule):
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:
self.counts[track.path.as_posix()] = self.counts.get(track.path.as_posix(), 0) + 1
if sum(self.counts.values()) % 3 == 0: self._save_counts()
self._save_counts()
def shutdown(self):
self._save_counts()