Documentation
¶
Overview ¶
Package history persists the user's recently played tracks to a TOML file in the cliamp config directory. Entries are recorded when a track has been played past the scrobble threshold (the same heuristic Last.fm and the Navidrome scrobbler use) so skipped tracks never enter the list.
The store is safe for concurrent callers and writes atomically (temp file + rename) so a crash mid-write cannot leave a half-finished history.toml.
Index ¶
Constants ¶
const DefaultCap = 200
DefaultCap is the maximum number of entries kept on disk. Older entries are dropped FIFO once the cap is exceeded.
const PlaylistName = "Recently Played"
PlaylistName is the virtual playlist name surfaced to the UI by the local provider. Browsing this name returns history entries newest-first.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads and writes the history TOML file.
func New ¶
func New() *Store
New returns a Store backed by ~/.config/cliamp/history.toml. Returns nil if the config directory cannot be resolved (rare; same failure mode as the local playlist provider).
func (*Store) Record ¶
Record appends an entry for track played at playedAt. If the most recent entry has the same path and was logged within dedupWindow, its timestamp is updated in place instead of duplicating the row. Empty paths are ignored.