library

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeFilename added in v0.1.4

func SanitizeFilename(s string) string

Ensure there are no characters in a string that would be problematic for a filename, replaces them with underscore characters (_).

Types

type Album

type Album struct {
	Name string
	// Tracks holds track titles as keys for fast lookups
	// Track titles are formated as 'TrackNo - TrackTitle', see GetTrackKey method
	Tracks map[string]struct{}
}

func NewAlbum

func NewAlbum(albumName, trackName string) *Album

type Artist

type Artist struct {
	Name   string
	Albums map[string]*Album
}

type Library

type Library struct {
	Root    string
	Artists map[string]*Artist
	sync.Mutex
}

func LoadLibrary

func LoadLibrary(root string) (*Library, error)

func (*Library) FileMarkStored

func (l *Library) FileMarkStored(t *Track, filename string) error

Unhide the file now that its finished

func (*Library) GetAlbumKey added in v0.1.8

func (l *Library) GetAlbumKey(t *Track) string

func (*Library) GetArtistKey added in v0.1.8

func (l *Library) GetArtistKey(t *Track) string

func (*Library) GetTrackKey added in v0.1.8

func (l *Library) GetTrackKey(t *Track) string

func (*Library) MarkStored

func (l *Library) MarkStored(t *Track)

func (*Library) Stored

func (l *Library) Stored(t *Track) bool

func (*Library) String

func (l *Library) String() string

func (*Library) UnmarkStored

func (l *Library) UnmarkStored(t *Track)

func (*Library) Watch

func (l *Library) Watch(ctx context.Context) error

type Track

type Track struct {
	Title       string
	Artist      string
	AlbumArtist string
	Album       string
	TrackNumber int32
	DiscNumber  int32
	Length      time.Duration
	ArtURL      string
	URL         string
	TrackID     string
	AutoRating  float64
	Format      string
	MediaPlayer string
}

func (*Track) FancyString added in v0.1.1

func (t *Track) FancyString(enableColors bool) string

func (*Track) IsSameTrackAs added in v0.1.1

func (t *Track) IsSameTrackAs(other *Track) bool

func (*Track) RelPath

func (t *Track) RelPath() string

func (*Track) String

func (t *Track) String() string

func (*Track) UpdateTrack added in v0.1.1

func (t *Track) UpdateTrack(other *Track)

Jump to

Keyboard shortcuts

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