tracklog

package
v0.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package tracklog persists live-radio title changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// PlayedAt is when the metadata first became current.
	PlayedAt time.Time `json:"played_at"`
	// Station is the station display name.
	Station string `json:"station"`
	// StationURL is the original station address.
	StationURL string `json:"station_url"`
	// Artist is the parsed artist when one was supplied.
	Artist string `json:"artist,omitempty"`
	// Title is the parsed song or program title.
	Title string `json:"title"`
	// Raw is the exact sanitized stream title.
	Raw string `json:"raw"`
	// Artwork is the station image URL when available.
	Artwork string `json:"artwork,omitempty"`
}

Entry is one observed radio title transition.

type Store

type Store struct {
	// Path is the JSON history location.
	Path string
	// contains filtered or unexported fields
}

Store serializes the bounded track log.

func DefaultStore

func DefaultStore() *Store

DefaultStore uses the user's standard configuration directory.

func (*Store) Clear

func (s *Store) Clear() error

Clear removes all saved entries while retaining a valid empty file.

func (*Store) Load

func (s *Store) Load(limit int) ([]Entry, error)

Load returns newest entries first and applies an optional limit.

func (*Store) Record

func (s *Store) Record(entry Entry) error

Record appends a transition, coalescing a repeated title within five minutes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL