lyrics

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	Text    string
	Time    time.Duration
	HasTime bool
}

Line represents a single lyric line.

type Lyrics

type Lyrics struct {
	Lines      []Line
	Timed      bool
	Raw        string
	Source     Source
	SourcePath string
}

Lyrics holds parsed lyrics data.

type Provider

type Provider interface {
	// contains filtered or unexported methods
}

Provider resolves lyrics for a track.

func NewEmbeddedProvider

func NewEmbeddedProvider(read RawLyricsReader) Provider

NewEmbeddedProvider creates a provider for embedded tags.

func NewLrcLibProvider

func NewLrcLibProvider(cfg config.LrcLibConfig, cacheBaseDir string) Provider

NewLrcLibProvider creates a provider for the lrclib.net API.

func NewSidecarProvider

func NewSidecarProvider() Provider

NewSidecarProvider creates a provider for sidecar lyric files.

type RawLyricsReader

type RawLyricsReader func(path string) (string, error)

RawLyricsReader returns raw embedded lyrics for a track path.

type Resolver

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

Resolver tries multiple providers in order.

func NewResolver

func NewResolver(providers ...Provider) *Resolver

NewResolver creates a resolver with the given providers. Providers are tried in the order they are given.

func (*Resolver) Find

func (r *Resolver) Find(track TrackInfo) (Lyrics, error)

Find returns the first available lyrics from configured providers.

type Source

type Source string

Source identifies where lyrics were found.

type TrackInfo

type TrackInfo struct {
	Path     string
	Name     string
	Artist   string
	Title    string
	Album    string
	Duration time.Duration
}

TrackInfo provides minimal context for resolving lyrics.

Jump to

Keyboard shortcuts

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