lastFm

package
v0.0.0-...-6ebd40e Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: GPL-3.0 Imports: 15 Imported by: 3

Documentation

Overview

Package lastFm handles the retrieval of song data from Last.FM.

Index

Constants

This section is empty.

Variables

View Source
var UseRedis bool

Functions

func ReadCache

func ReadCache(userID string, cachePrefix string, songs interface{}) error

func ReadCachedUniqueSongs

func ReadCachedUniqueSongs(userID string, songs *SongMap) error

ReadCachedUniqueSongs reads back a cache of mapped songs from the local directory.

func WriteCache

func WriteCache(userID string, cachePrefix string, songs interface{}) error

Types

type BaseSong

type BaseSong struct {
	Artist string
	Title  string
}

BaseSong has an artist name and the title of the song.

type Song

type Song struct {
	Artist    string
	Title     string
	Timestamp time.Time
}

Song has an artist name, the title of the song, and when the song was scrobbled by the user.

func ReadLastFMSongs

func ReadLastFMSongs(userID string) ([]Song, error)

ReadLastFMSongs retrieves all scrobbled Last.FM songs for a specific user. Returns an error on failure.

type SongMap

type SongMap struct {
	Songs map[BaseSong]bool
}

SongMap wraps a map of songs for easy serialization.

type SongsPage

type SongsPage struct {
	RecentTracks tracksWrapper `json:"recentTracks"`
}

SongsPage holds a list of tracks in a page.

Jump to

Keyboard shortcuts

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