cover

package
v0.0.0-...-0381c42 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound   = errors.New("no cover art found")
	ErrNoChafa    = errors.New("chafa is not installed")
	ErrNoMetadata = errors.New("no embedded or folder art, and no metadata to search online")
)

Functions

func DefaultCacheDir

func DefaultCacheDir() string

DefaultCacheDir returns the per-user cache directory for downloaded covers.

func Render

func Render(art *Art, width, height int) (string, error)

Render converts art to ANSI symbols via chafa and returns its display lines.

Types

type Art

type Art struct {
	Path   string
	Data   []byte
	Source Source
}

Art is a resolved cover image plus where it came from.

func Resolve

func Resolve(trackPath, artist, album, cacheDir string) (*Art, error)

Resolve finds cover art for a track: embedded tag art first, then a cover file beside the track, then an online fetch cached on disk.

type Source

type Source string

Source describes where the cover art came from, shown in the UI.

const (
	SourceEmbedded Source = "embedded"
	SourceFolder   Source = "folder file"
	SourceCache    Source = "cache"
	SourceOnline   Source = "iTunes"
)

Jump to

Keyboard shortcuts

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