station

package
v0.2.8 Latest Latest
Warning

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

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

Documentation

Overview

Package station defines the data structures for SomaFM radio stations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Playlist

type Playlist struct {
	URL     string `json:"url"`
	Format  string `json:"format"`  // Audio format (e.g., "mp3", "aac")
	Quality string `json:"quality"` // Quality level (e.g., "highest", "high")
}

Playlist represents a streaming endpoint for a radio station.

type Station

type Station struct {
	ID          string     `json:"id"`
	Title       string     `json:"title"`
	Description string     `json:"description"`
	DJ          string     `json:"dj"`
	DJMail      string     `json:"djmail"`
	Genre       string     `json:"genre"` // Pipe-separated genre list
	Image       string     `json:"image"`
	LargeImage  string     `json:"largeimage"`
	XLImage     string     `json:"xlimage"`
	Twitter     string     `json:"twitter"`
	Updated     string     `json:"updated"`
	Playlists   []Playlist `json:"playlists"`
	Preroll     []string   `json:"preroll"`
	Listeners   string     `json:"listeners"`
	LastPlaying string     `json:"lastPlaying"`
}

Station represents a SomaFM radio station with its metadata and streaming options.

func (*Station) GetAllPlaylistURLs

func (s *Station) GetAllPlaylistURLs() []string

GetAllPlaylistURLs returns all playlist URLs sorted by preference: MP3 highest quality first, then other MP3, then other formats.

func (*Station) GetBestPlaylistURL

func (s *Station) GetBestPlaylistURL() string

GetBestPlaylistURL returns the URL of the highest quality MP3 playlist. Falls back to the first available playlist if no MP3 "highest" quality is found.

Jump to

Keyboard shortcuts

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