radio

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxRecent = 3

DefaultMaxRecent is the number of recently played tracks to remember for avoiding repetition in playlist generation

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages radios for all moods

func NewManager

func NewManager(repo *inventory.Repository) *Manager

NewManager creates a new radio manager

func (*Manager) GetPlaylist

func (m *Manager) GetPlaylist(mood string, instrumentalOnly bool) ([]*inventory.Track, error)

GetPlaylist returns the playlist for a mood

func (*Manager) GetRadio

func (m *Manager) GetRadio(mood string) *Radio

GetRadio returns the radio for a mood (creates if needed)

func (*Manager) RecordPlay

func (m *Manager) RecordPlay(mood string, trackID int64)

RecordPlay records a play for the mood's radio

type Radio

type Radio struct {
	// contains filtered or unexported fields
}

Radio manages playlist generation for a mood

func NewRadio

func NewRadio(repo *inventory.Repository, mood string) *Radio

NewRadio creates a new radio for a mood

func (*Radio) GetPlaylist

func (r *Radio) GetPlaylist(instrumentalOnly bool) ([]*inventory.Track, error)

GetPlaylist returns a shuffled playlist for the mood. Recently played tracks are pushed to the end of the playlist.

func (*Radio) RecordPlay

func (r *Radio) RecordPlay(trackID int64)

RecordPlay records that a track was played

Jump to

Keyboard shortcuts

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