albumart

package
v0.0.0-...-6217932 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlbumArtCache

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

AlbumArtCache retrieves album art from last.fm and caches it in the global database.

func NewAlbumArtCache

func NewAlbumArtCache(db services.Database, apiKey string) *AlbumArtCache

func (*AlbumArtCache) GetAlbumArt

func (ac *AlbumArtCache) GetAlbumArt(artist, album string) []byte

GetAlbumArt returns a JPEG-encoded image for the specified album. If no image could be found, an empty 1x1 blank JPEG is returned.

type AlbumArtEntry

type AlbumArtEntry struct {
	Img       []byte
	Timestamp int64
}

AlbumArtEntry is what we store in the database. It can either contain the actual image data, or be a negative-cache entry with a ttl (in which case, Img will be nil).

func (*AlbumArtEntry) HasExpired

func (e *AlbumArtEntry) HasExpired() bool

type LastFmImage

type LastFmImage struct {
	Size string `xml:"size,attr"`
	Url  string `xml:",chardata"`
}

func (*LastFmImage) GetSizeIndex

func (i *LastFmImage) GetSizeIndex() int

type LastFmImages

type LastFmImages []LastFmImage

func (LastFmImages) Len

func (l LastFmImages) Len() int

func (LastFmImages) Swap

func (l LastFmImages) Swap(i, j int)

type LastFmMeta

type LastFmMeta struct {
	XMLName xml.Name      `xml:"lfm"`
	Images  []LastFmImage `xml:"album>image"`
}

type SortedLastFmImages

type SortedLastFmImages struct {
	LastFmImages
}

func (SortedLastFmImages) Less

func (l SortedLastFmImages) Less(i, j int) bool

Less actually implements a reverse sort.

Jump to

Keyboard shortcuts

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