analysis

package
v0.0.0-...-e1ec090 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmbiguousTrackCount

type AmbiguousTrackCount struct {
	Playcount int
	Name      string
}

type Analysis

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

Analysis holds methods for generating API responses

func CreateService

func CreateService() *Analysis

CreateService creates an instance of the analysis service object

func (Analysis) AddUserToPlays

func (a Analysis) AddUserToPlays(plays []db.Scrobble) ([]db.Scrobble, error)

func (Analysis) AlbumTopTracks

func (a Analysis) AlbumTopTracks(userID int64, albumID int64) ([]AmbiguousTrackCount, error)

func (Analysis) ArtistTopAlbums

func (a Analysis) ArtistTopAlbums(userID int64, artistID int64) ([]db.AlbumCount, error)

func (Analysis) ArtistTopTracks

func (a Analysis) ArtistTopTracks(userID int64, artistID int64) ([]AmbiguousTrackCount, error)

func (Analysis) CacheTagsForArtist

func (a Analysis) CacheTagsForArtist(artistName string)

func (Analysis) CountTags

func (a Analysis) CountTags(settings *model.TagsSettings) (int, error)

func (Analysis) GetArtistRank

func (a Analysis) GetArtistRank(artist *db.Artist, user *db.User, serverID *string)

func (Analysis) GetTags

func (a Analysis) GetTags(settings *model.TagsSettings) ([]TagResponse, error)

func (Analysis) RequireTagsForMissing

func (a Analysis) RequireTagsForMissing(artistInputs []*model.ArtistInput) error

func (Analysis) SearchArtist

func (a Analysis) SearchArtist(criteria model.ArtistSearchCriteria, settings *model.SearchSettings) ([]SearchArtistResult, error)

func (Analysis) TagArtists

func (a Analysis) TagArtists(artists []*model.ArtistInput, tags []*model.TagInput) error

func (Analysis) TrackTopAlbums

func (a Analysis) TrackTopAlbums(userID int64, trackIDs []int64) ([]db.TrackCount, error)

func (Analysis) WhoFirstArtist

func (a Analysis) WhoFirstArtist(artist *db.Artist, settings *model.WhoKnowsSettings, whoLast bool, excludeIDs []int64) ([]db.Scrobble, error)

WhoFirstArtist returns a list of who first listened to an artist

func (Analysis) WhoHasUndatedArtist

func (a Analysis) WhoHasUndatedArtist(artist *db.Artist, settings *model.WhoKnowsSettings, whoLast bool) ([]db.Scrobble, error)

func (Analysis) WhoKnowsAlbum

func (a Analysis) WhoKnowsAlbum(album *db.Album, settings *model.WhoKnowsSettings) ([]db.AlbumCount, error)

WhoKnowsAlbum returns a list of who has listened to an album

func (Analysis) WhoKnowsArtist

func (a Analysis) WhoKnowsArtist(artist *db.Artist, settings *model.WhoKnowsSettings) ([]db.ArtistCount, error)

WhoKnowsArtist returns a list of who has listened to an artist

func (Analysis) WhoKnowsTrack

func (a Analysis) WhoKnowsTrack(tracks []db.Track, settings *model.WhoKnowsSettings) ([]*model.WhoKnowsRow, error)

WhoKnowsTrack returns a list of who has listened to an album

type SearchArtistResult

type SearchArtistResult struct {
	ID              int64
	Name            string
	ListenerCount   int
	GlobalPlaycount int
}

type TagResponse

type TagResponse struct {
	Name        string
	Occurrences int
}

type UsersMap

type UsersMap = map[int64]db.User

type WhoKnowsTrackRow

type WhoKnowsTrackRow struct {
	Playcount int64

	UserID    int64
	Username  string
	Privacy   int64
	DiscordID string
}

WhoKnowsTrackRow represents a raw row of a who knows track query

Jump to

Keyboard shortcuts

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