data

package
v0.0.0-...-b3bfe55 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Week    = 7 * 24 * time.Hour
	Month   = 4 * Week
	Year    = 52 * Week
	Forever = 100 * Year
)

Simplified constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	AlbumArtist string
	Album       string
	Count       int
}

type Artist

type Artist struct {
	Artist string
	Count  int
}

type ArtistRankings

type ArtistRankings struct {
	Overall, Year, Month, Week []Artist
}

type Database

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

func Open

func Open(path string) (*Database, error)

func (*Database) Add

func (d *Database) Add(scrobble Scrobble) error

func (*Database) AddMultiple

func (d *Database) AddMultiple(scrobbles []Scrobble) error

func (*Database) AlbumPlays

func (d *Database) AlbumPlays(albumArtist, album string) (plays []PlayCount)

func (*Database) AlbumTracks

func (d *Database) AlbumTracks(albumArtist, album string) (tracks []Track, err error)

func (*Database) ArtistPlays

func (d *Database) ArtistPlays(name string) (plays []PlayCount)

func (*Database) ArtistTopAlbums

func (d *Database) ArtistTopAlbums(name string, limit int) (albums []Album, err error)

func (*Database) ArtistTopTracks

func (d *Database) ArtistTopTracks(name string, limit int) (tracks []Track, err error)

func (*Database) Close

func (d *Database) Close() error

func (*Database) GetNowPlaying

func (d *Database) GetNowPlaying() (*Playing, bool)

func (*Database) GetTrack

func (d *Database) GetTrack(albumArtist, album, track string) (*Track, error)

func (*Database) NowPlaying

func (d *Database) NowPlaying(playing Playing) error

func (*Database) Played

func (d *Database) Played(from time.Time) (scrobbles []Scrobble, err error)

func (*Database) RecentlyPlayed

func (d *Database) RecentlyPlayed() (scrobbles []Scrobble, err error)

func (*Database) Scrobble

func (d *Database) Scrobble(at string) (scrobble Scrobble, ok bool)

func (*Database) TopArtists

func (d *Database) TopArtists(limit int) (rankings ArtistRankings, err error)

func (*Database) TopTracks

func (d *Database) TopTracks(limit int) (rankings TrackRankings, err error)

func (*Database) TotalPlays

func (d *Database) TotalPlays() (count int)

func (*Database) TrackPlays

func (d *Database) TrackPlays(albumArtist, album, track string) (plays []PlayCount)

type PlayCount

type PlayCount struct {
	Year  int
	Month time.Month
	Count int
}

type Playing

type Playing struct {
	Artist, AlbumArtist, Album, Track string
}

type Scrobble

type Scrobble struct {
	Artist, AlbumArtist, Album, Track string
	Timestamp                         int64
}

type Track

type Track struct {
	Artist      string
	AlbumArtist string
	Album       string
	Track       string
	Count       int
}

type TrackRankings

type TrackRankings struct {
	Overall, Year, Month, Week []Track
}

Jump to

Keyboard shortcuts

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