lastfm

package
v0.0.0-...-ee9263c Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageIdForArtist

func GetImageIdForArtist(ctx context.Context, artistUrl string) (string, error)

func GetLastFmResponse

func GetLastFmResponse[T LastFMResponse](ctx context.Context, collageType constants.CollageType, username string, period constants.Period, count int) (*T, error)

func GetTrackInfo

func GetTrackInfo(trackName string, artistName string, imageSize string) (*models.TrackInfo, error)

Types

type CleanError

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

func (CleanError) Error

func (e CleanError) Error() string

type GetTrackInfoResponse

type GetTrackInfoResponse struct {
	Track struct {
		Album struct {
			AlbumName string        `json:"title"`
			Images    []LastFMImage `json:"image"`
		} `json:"Album"`
	} `json:"track"`
}

type LastFMImage

type LastFMImage struct {
	Size string `json:"size"`
	Link string `json:"#text"`
}

type LastFMResponse

type LastFMResponse interface {
	Append(l LastFMResponse) error
	GetTotalPages() int
	GetTotalFetched() int
}

type LastFMUser

type LastFMUser struct {
	User       string `json:"user"`
	TotalPages string `json:"totalPages"`
	Page       string `json:"page"`
	PerPage    string `json:"perPage"`
	Total      string `json:"total"`
}

Jump to

Keyboard shortcuts

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