models

package
v0.0.0-...-71679b6 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SubmissionAgent = "piper/v0.0.6"

Variables

This section is empty.

Functions

This section is empty.

Types

type ATprotoAuthData

type ATprotoAuthData struct {
	State               string  `json:"state"`
	DID                 string  `json:"did"`
	PDSUrl              string  `json:"pds_url"`
	AuthServerIssuer    string  `json:"authserver_issuer"`
	PARState            string  `json:"par_state"`
	PKCEVerifier        string  `json:"pkce_verifier"`
	DPoPAuthServerNonce string  `json:"dpop_authserver_nonce"`
	DPoPPrivateJWK      jwk.Key `json:"dpop_private_jwk"`
}

type ATprotoAuthSession

type ATprotoAuthSession struct {
	ID                  string    `json:"id"`
	DID                 string    `json:"did"`
	PDSUrl              string    `json:"pds_url"`
	AuthServerIssuer    string    `json:"authserver_issuer"`
	AccessToken         string    `json:"access_token"`
	RefreshToken        string    `json:"refresh_token"`
	DpopPdsNonce        string    `json:"dpop_pds_nonce"`
	DpopAuthServerNonce string    `json:"dpop_authserver_nonce"`
	DpopPrivateJWK      jwk.Key   `json:"dpop_private_jwk"`
	TokenExpiry         time.Time `json:"expires_at"`
}

type Artist

type Artist struct {
	Name string  `json:"name"`
	ID   string  `json:"id"`
	MBID *string `json:"mbid,omitempty"`
}

type ListenBrainzAdditionalInfo

type ListenBrainzAdditionalInfo struct {
	MediaPlayer             *string  `json:"media_player,omitempty"`
	SubmissionClient        *string  `json:"submission_client,omitempty"`
	SubmissionClientVersion *string  `json:"submission_client_version,omitempty"`
	RecordingMBID           *string  `json:"recording_mbid,omitempty"`
	ArtistMBIDs             []string `json:"artist_mbids,omitempty"`
	ReleaseMBID             *string  `json:"release_mbid,omitempty"`
	ReleaseGroupMBID        *string  `json:"release_group_mbid,omitempty"`
	TrackMBID               *string  `json:"track_mbid,omitempty"`
	WorkMBIDs               []string `json:"work_mbids,omitempty"`
	Tags                    []string `json:"tags,omitempty"`
	DurationMs              *int64   `json:"duration_ms,omitempty"`
	SpotifyID               *string  `json:"spotify_id,omitempty"`
	ISRC                    *string  `json:"isrc,omitempty"`
	TrackNumber             *int     `json:"tracknumber,omitempty"`
	DiscNumber              *int     `json:"discnumber,omitempty"`
	MusicService            *string  `json:"music_service,omitempty"`
	MusicServiceName        *string  `json:"music_service_name,omitempty"`
	OriginURL               *string  `json:"origin_url,omitempty"`
	LastFMTrackURL          *string  `json:"lastfm_track_url,omitempty"`
	YoutubeID               *string  `json:"youtube_id,omitempty"`
}

ListenBrainzAdditionalInfo contains optional metadata

type ListenBrainzPayload

type ListenBrainzPayload struct {
	ListenedAt    *int64                    `json:"listened_at,omitempty"`
	TrackMetadata ListenBrainzTrackMetadata `json:"track_metadata"`
}

ListenBrainzPayload represents individual listen data

func (*ListenBrainzPayload) ConvertToTrack

func (lbp *ListenBrainzPayload) ConvertToTrack() Track

ConvertToTrack converts ListenBrainz format to internal Track format

type ListenBrainzSubmission

type ListenBrainzSubmission struct {
	ListenType string                `json:"listen_type"`
	Payload    []ListenBrainzPayload `json:"payload"`
}

ListenBrainzSubmission represents the top-level submission format

type ListenBrainzTrackMetadata

type ListenBrainzTrackMetadata struct {
	ArtistName     string                      `json:"artist_name"`
	TrackName      string                      `json:"track_name"`
	ReleaseName    *string                     `json:"release_name,omitempty"`
	AdditionalInfo *ListenBrainzAdditionalInfo `json:"additional_info,omitempty"`
}

ListenBrainzTrackMetadata contains the track information

type TealFmFeedPlay

type TealFmFeedPlay struct {
	Type                  string   `json:"$type"`
	Duration              int      `json:"duration"`
	TrackName             string   `json:"trackName"`
	PlayedTime            string   `json:"playedTime"`
	ArtistMbIDs           []string `json:"artistMbIds"`
	ArtistNames           []string `json:"artistNames"`
	ReleaseMBID           string   `json:"releaseMbId"`
	ReleaseName           string   `json:"releaseName"`
	RecordingMBID         string   `json:"recordingMbId"`
	SubmissionClientAgent string   `json:"submissionClientAgent"`
}

func (TealFmFeedPlay) MarshalCBOR

func (tfmTrack TealFmFeedPlay) MarshalCBOR(w io.Writer) error

type Track

type Track struct {
	PlayID int64  `json:"playId"`
	Name   string `json:"name"`
	// analogous to "track"
	RecordingMBID *string  `json:"trackMBID,omitempty"`
	Artist        []Artist `json:"artist"`
	Album         string   `json:"album"`
	// analogous to "album"
	ReleaseMBID    *string   `json:"releaseMBID,omitempty"`
	URL            string    `json:"url"`
	Timestamp      time.Time `json:"timestamp"`
	DurationMs     int64     `json:"durationMs"`
	ProgressMs     int64     `json:"progressMs"`
	ServiceBaseUrl string    `json:"serviceBaseUrl"`
	ISRC           string    `json:"isrc"`
	HasStamped     bool      `json:"hasStamped"`
}

Track represents a Spotify track

type User

type User struct {
	ID       int64
	Username *string
	Email    *string

	// spotify information
	SpotifyID    *string
	AccessToken  *string
	RefreshToken *string
	TokenExpiry  *time.Time

	// lfm information
	LastFMUsername *string

	// Apple Music
	AppleMusicUserToken *string

	// atp info
	ATProtoDID *string
	//This is meant to only be used by the automated music stamping service. If the user ever does an
	//atproto action from the web ui use the atproto session id for the logged-in session
	MostRecentAtProtoSessionID *string

	CreatedAt time.Time
	UpdatedAt time.Time
}

User an end user of piper

Jump to

Keyboard shortcuts

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