From b9c4f1dcf1333c14e2d1b67561ec7a5f955baa6e Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sun, 9 Aug 2026 20:04:39 +0100 Subject: Initial commit --- src/HistoryStorage.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/HistoryStorage.php (limited to 'src/HistoryStorage.php') diff --git a/src/HistoryStorage.php b/src/HistoryStorage.php new file mode 100644 index 0000000..30d9ace --- /dev/null +++ b/src/HistoryStorage.php @@ -0,0 +1,41 @@ +filename, json_encode($this, JSON_PRETTY_PRINT)); + } + + public function saveSong(array $song): void + { + $this->history[$song['id']] = [ + 'timestamp' => time(), + 'details' => $song, + ]; + $this->save(); + } +} -- cgit v1.2.3-13-gbd6f