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 ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.