scrobble

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: GPL-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 ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Code    uint   `json:"error"`
}

func (ErrorResponse) Error

func (er ErrorResponse) Error() string

type NowPlayingResponse

type NowPlayingResponse struct {
	NowPlaying struct {
		Artist struct {
			Corrected string `json:"corrected"`
			Text      string `json:"#text"`
		} `json:"artist"`
		Track struct {
			Corrected string `json:"corrected"`
			Text      string `json:"#text"`
		} `json:"track"`
		IgnoredMessage struct {
			Code string `json:"code"`
			Text string `json:"#text"`
		} `json:"ignoredMessage"`
		AlbumArtist struct {
			Corrected string `json:"corrected"`
			Text      string `json:"#text"`
		} `json:"albumArtist"`
		Album struct {
			Corrected string `json:"corrected"`
			Text      string `json:"#text"`
		} `json:"album"`
	} `json:"nowplaying"`
}

type ScrobbleResponse

type ScrobbleResponse struct {
	Scrobbles struct {
		Scrobble struct {
			Artist struct {
				Corrected string `json:"corrected"`
				Text      string `json:"#text"`
			} `json:"artist"`
			Track struct {
				Corrected string `json:"corrected"`
				Text      string `json:"#text"`
			} `json:"track"`
			IgnoredMessage struct {
				Code string `json:"code"`
				Text string `json:"#text"`
			} `json:"ignoredMessage"`
			AlbumArtist struct {
				Corrected string `json:"corrected"`
				Text      string `json:"#text"`
			} `json:"albumArtist"`
			Album struct {
				Corrected string `json:"corrected"`
				Text      string `json:"#text"`
			} `json:"album"`
			Timestamp string `json:"timestamp"`
		} `json:"scrobble"`
		Attr struct {
			Ignored  int `json:"ignored"`
			Accepted int `json:"accepted"`
		} `json:"@attr"`
	} `json:"scrobbles"`
}

type Service

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

func New

func New(
	cfg config.Credentials,
	sessionCache *sessioncache.Service,
) *Service

func (*Service) Scrobble

func (s *Service) Scrobble(ctx context.Context, data models.Track) (ScrobbleResponse, error)

func (*Service) SendNowPlaying

func (s *Service) SendNowPlaying(
	ctx context.Context,
	data models.Track,
) (NowPlayingResponse, error)

Jump to

Keyboard shortcuts

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