diff --git a/api/teal/actordefs.go b/api/teal/actordefs.go index 81e92f2..4afeda0 100644 --- a/api/teal/actordefs.go +++ b/api/teal/actordefs.go @@ -34,4 +34,16 @@ type AlphaActorDefs_ProfileView struct { DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` // featuredItem: The user's most recent item featured on their profile. FeaturedItem *AlphaActorProfile_FeaturedItem `json:"featuredItem,omitempty" cborgen:"featuredItem,omitempty"` + Status *AlphaActorDefs_StatusView `json:"status,omitempty" cborgen:"status,omitempty"` +} + +// AlphaActorDefs_StatusView is a "statusView" in the fm.teal.alpha.actor.defs schema. +// +// A declaration of the status of the actor. +type AlphaActorDefs_StatusView struct { + // expiry: The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time. + Expiry *string `json:"expiry,omitempty" cborgen:"expiry,omitempty"` + Item *AlphaFeedDefs_PlayView `json:"item,omitempty" cborgen:"item,omitempty"` + // time: The unix timestamp of when the item was recorded + Time *string `json:"time,omitempty" cborgen:"time,omitempty"` } diff --git a/api/teal/actorprofile.go b/api/teal/actorprofile.go index 7f5fd79..4c91736 100644 --- a/api/teal/actorprofile.go +++ b/api/teal/actorprofile.go @@ -28,7 +28,7 @@ type AlphaActorProfile struct { // AlphaActorProfile_FeaturedItem is a "featuredItem" in the fm.teal.alpha.actor.profile schema. type AlphaActorProfile_FeaturedItem struct { - // mbid: The Musicbrainz ID of the item + // mbid: The MusicBrainz ID URI of the item, formatted as mbid: Mbid string `json:"mbid" cborgen:"mbid"` // type: The type of the item. Must be a valid Musicbrainz type, e.g. album, track, recording, etc. Type string `json:"type" cborgen:"type"` diff --git a/api/teal/actorprofileStatus.go b/api/teal/actorprofileStatus.go new file mode 100644 index 0000000..2ad120d --- /dev/null +++ b/api/teal/actorprofileStatus.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package teal + +import "github.com/bluesky-social/indigo/lex/util" + +// schema: fm.teal.alpha.actor.profileStatus + +// RECORDTYPE: AlphaActorProfileStatus +type AlphaActorProfileStatus struct { + LexiconTypeID string `json:"$type,const=fm.teal.alpha.actor.profileStatus" cborgen:"$type,const=fm.teal.alpha.actor.profileStatus"` + // completedOnboarding: The onboarding completion status + CompletedOnboarding string `json:"completedOnboarding" cborgen:"completedOnboarding"` + // createdAt: The timestamp when this status was created + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` + // updatedAt: The timestamp when this status was last updated + UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` +} + +func init() { + util.RegisterType("fm.teal.alpha.actor.profileStatus", &AlphaActorProfileStatus{}) +} diff --git a/api/teal/actorstatus.go b/api/teal/actorstatus.go index 6a94f79..0187f31 100644 --- a/api/teal/actorstatus.go +++ b/api/teal/actorstatus.go @@ -9,10 +9,10 @@ import "github.com/bluesky-social/indigo/lex/util" // RECORDTYPE: AlphaActorStatus type AlphaActorStatus struct { LexiconTypeID string `json:"$type,const=fm.teal.alpha.actor.status" cborgen:"$type,const=fm.teal.alpha.actor.status"` - // expiry: The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time. + // expiry: The RFC 3339 formatted time of the expiry time of the item. If unavailable, default to 10 minutes past the start time. Expiry *string `json:"expiry,omitempty" cborgen:"expiry,omitempty"` Item *AlphaFeedDefs_PlayView `json:"item" cborgen:"item"` - // time: The unix timestamp of when the item was recorded + // time: The RFC 3339 formatted time of when the item was recorded Time string `json:"time" cborgen:"time"` } diff --git a/api/teal/cbor_gen.go b/api/teal/cbor_gen.go index 6569275..7f13ec9 100644 --- a/api/teal/cbor_gen.go +++ b/api/teal/cbor_gen.go @@ -27,7 +27,7 @@ func (t *AlphaFeedPlay) MarshalCBOR(w io.Writer) error { } cw := cbg.NewCborWriter(w) - fieldCount := 15 + fieldCount := 17 if t.ArtistMbIds == nil { fieldCount-- @@ -65,6 +65,10 @@ func (t *AlphaFeedPlay) MarshalCBOR(w io.Writer) error { fieldCount-- } + if t.ReleaseDiscriminant == nil { + fieldCount-- + } + if t.ReleaseMbId == nil { fieldCount-- } @@ -77,6 +81,10 @@ func (t *AlphaFeedPlay) MarshalCBOR(w io.Writer) error { fieldCount-- } + if t.TrackDiscriminant == nil { + fieldCount-- + } + if t.TrackMbId == nil { fieldCount-- } @@ -484,6 +492,70 @@ func (t *AlphaFeedPlay) MarshalCBOR(w io.Writer) error { } } + // t.TrackDiscriminant (string) (string) + if t.TrackDiscriminant != nil { + + if len("trackDiscriminant") > 1000000 { + return xerrors.Errorf("Value in field \"trackDiscriminant\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("trackDiscriminant"))); err != nil { + return err + } + if _, err := cw.WriteString(string("trackDiscriminant")); err != nil { + return err + } + + if t.TrackDiscriminant == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.TrackDiscriminant) > 1000000 { + return xerrors.Errorf("Value in field t.TrackDiscriminant was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.TrackDiscriminant))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.TrackDiscriminant)); err != nil { + return err + } + } + } + + // t.ReleaseDiscriminant (string) (string) + if t.ReleaseDiscriminant != nil { + + if len("releaseDiscriminant") > 1000000 { + return xerrors.Errorf("Value in field \"releaseDiscriminant\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("releaseDiscriminant"))); err != nil { + return err + } + if _, err := cw.WriteString(string("releaseDiscriminant")); err != nil { + return err + } + + if t.ReleaseDiscriminant == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.ReleaseDiscriminant) > 1000000 { + return xerrors.Errorf("Value in field t.ReleaseDiscriminant was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.ReleaseDiscriminant))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.ReleaseDiscriminant)); err != nil { + return err + } + } + } + // t.SubmissionClientAgent (string) (string) if t.SubmissionClientAgent != nil { @@ -925,6 +997,48 @@ func (t *AlphaFeedPlay) UnmarshalCBOR(r io.Reader) (err error) { t.RecordingMbId = (*string)(&sval) } } + // t.TrackDiscriminant (string) (string) + case "trackDiscriminant": + + { + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.TrackDiscriminant = (*string)(&sval) + } + } + // t.ReleaseDiscriminant (string) (string) + case "releaseDiscriminant": + + { + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.ReleaseDiscriminant = (*string)(&sval) + } + } // t.SubmissionClientAgent (string) (string) case "submissionClientAgent": @@ -1457,6 +1571,251 @@ func (t *AlphaActorProfile) UnmarshalCBOR(r io.Reader) (err error) { return nil } +func (t *AlphaActorProfileStatus) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 4 + + if t.CreatedAt == nil { + fieldCount-- + } + + if t.UpdatedAt == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("fm.teal.alpha.actor.profileStatus"))); err != nil { + return err + } + if _, err := cw.WriteString(string("fm.teal.alpha.actor.profileStatus")); err != nil { + return err + } + + // t.CreatedAt (string) (string) + if t.CreatedAt != nil { + + if len("createdAt") > 1000000 { + return xerrors.Errorf("Value in field \"createdAt\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { + return err + } + if _, err := cw.WriteString(string("createdAt")); err != nil { + return err + } + + if t.CreatedAt == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.CreatedAt) > 1000000 { + return xerrors.Errorf("Value in field t.CreatedAt was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil { + return err + } + } + } + + // t.UpdatedAt (string) (string) + if t.UpdatedAt != nil { + + if len("updatedAt") > 1000000 { + return xerrors.Errorf("Value in field \"updatedAt\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("updatedAt"))); err != nil { + return err + } + if _, err := cw.WriteString(string("updatedAt")); err != nil { + return err + } + + if t.UpdatedAt == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.UpdatedAt) > 1000000 { + return xerrors.Errorf("Value in field t.UpdatedAt was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.UpdatedAt))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.UpdatedAt)); err != nil { + return err + } + } + } + + // t.CompletedOnboarding (string) (string) + if len("completedOnboarding") > 1000000 { + return xerrors.Errorf("Value in field \"completedOnboarding\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("completedOnboarding"))); err != nil { + return err + } + if _, err := cw.WriteString(string("completedOnboarding")); err != nil { + return err + } + + if len(t.CompletedOnboarding) > 1000000 { + return xerrors.Errorf("Value in field t.CompletedOnboarding was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CompletedOnboarding))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.CompletedOnboarding)); err != nil { + return err + } + return nil +} + +func (t *AlphaActorProfileStatus) UnmarshalCBOR(r io.Reader) (err error) { + *t = AlphaActorProfileStatus{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("AlphaActorProfileStatus: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 19) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = (*string)(&sval) + } + } + // t.UpdatedAt (string) (string) + case "updatedAt": + + { + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.UpdatedAt = (*string)(&sval) + } + } + // t.CompletedOnboarding (string) (string) + case "completedOnboarding": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CompletedOnboarding = string(sval) + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} func (t *AlphaActorStatus) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) diff --git a/api/teal/feeddefs.go b/api/teal/feeddefs.go index 1905969..10f14fd 100644 --- a/api/teal/feeddefs.go +++ b/api/teal/feeddefs.go @@ -6,7 +6,7 @@ package teal // AlphaFeedDefs_Artist is a "artist" in the fm.teal.alpha.feed.defs schema. type AlphaFeedDefs_Artist struct { - // artistMbId: The Musicbrainz ID of the artist + // artistMbId: The MusicBrainz artist ID URI, formatted as mbid: ArtistMbId *string `json:"artistMbId,omitempty" cborgen:"artistMbId,omitempty"` // artistName: The name of the artist ArtistName string `json:"artistName" cborgen:"artistName"` @@ -26,15 +26,15 @@ type AlphaFeedDefs_PlayView struct { OriginUrl *string `json:"originUrl,omitempty" cborgen:"originUrl,omitempty"` // playedTime: The unix timestamp of when the track was played PlayedTime *string `json:"playedTime,omitempty" cborgen:"playedTime,omitempty"` - // recordingMbId: The Musicbrainz recording ID of the track + // recordingMbId: The MusicBrainz recording ID URI of the track, formatted as mbid: RecordingMbId *string `json:"recordingMbId,omitempty" cborgen:"recordingMbId,omitempty"` - // releaseMbId: The Musicbrainz release ID + // releaseMbId: The MusicBrainz release ID URI, formatted as mbid: ReleaseMbId *string `json:"releaseMbId,omitempty" cborgen:"releaseMbId,omitempty"` // releaseName: The name of the release/album ReleaseName *string `json:"releaseName,omitempty" cborgen:"releaseName,omitempty"` // submissionClientAgent: A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b (Linux; Android 13; SM-A715F). Defaults to 'manual/unknown' if not provided. SubmissionClientAgent *string `json:"submissionClientAgent,omitempty" cborgen:"submissionClientAgent,omitempty"` - // trackMbId: The Musicbrainz ID of the track + // trackMbId: The MusicBrainz ID URI of the track, formatted as mbid: TrackMbId *string `json:"trackMbId,omitempty" cborgen:"trackMbId,omitempty"` // trackName: The name of the track TrackName string `json:"trackName" cborgen:"trackName"` diff --git a/api/teal/feedplay.go b/api/teal/feedplay.go index 8f79f13..9adc5cd 100644 --- a/api/teal/feedplay.go +++ b/api/teal/feedplay.go @@ -9,9 +9,9 @@ import "github.com/bluesky-social/indigo/lex/util" // RECORDTYPE: AlphaFeedPlay type AlphaFeedPlay struct { LexiconTypeID string `json:"$type,const=fm.teal.alpha.feed.play" cborgen:"$type,const=fm.teal.alpha.feed.play"` - // artistMbIds: Array of Musicbrainz artist IDs. Prefer using 'artists'. + // artistMbIds: DEPRECATED: USE 'artists' INSTEAD. Array of Musicbrainz artist IDs. ArtistMbIds []string `json:"artistMbIds,omitempty" cborgen:"artistMbIds,omitempty"` - // artistNames: Array of artist names in order of original appearance. Prefer using 'artists'. + // artistNames: DEPRECATED: USE 'artists' INSTEAD. Array of artist names in order of original appearance. ArtistNames []string `json:"artistNames,omitempty" cborgen:"artistNames,omitempty"` // artists: Array of artists in order of original appearance. Artists []*AlphaFeedDefs_Artist `json:"artists,omitempty" cborgen:"artists,omitempty"` @@ -25,15 +25,19 @@ type AlphaFeedPlay struct { OriginUrl *string `json:"originUrl,omitempty" cborgen:"originUrl,omitempty"` // playedTime: The unix timestamp of when the track was played PlayedTime *string `json:"playedTime,omitempty" cborgen:"playedTime,omitempty"` - // recordingMbId: The Musicbrainz recording ID of the track + // recordingMbId: The MusicBrainz recording ID URI of the track, formatted as mbid: RecordingMbId *string `json:"recordingMbId,omitempty" cborgen:"recordingMbId,omitempty"` - // releaseMbId: The Musicbrainz release ID + // releaseDiscriminant: Distinguishing information for release variants (e.g. 'Deluxe Edition', 'Remastered', '2023 Remaster', 'Special Edition'). Used to differentiate between different versions of the same base release while maintaining grouping capabilities. + ReleaseDiscriminant *string `json:"releaseDiscriminant,omitempty" cborgen:"releaseDiscriminant,omitempty"` + // releaseMbId: The MusicBrainz release ID URI, formatted as mbid: ReleaseMbId *string `json:"releaseMbId,omitempty" cborgen:"releaseMbId,omitempty"` // releaseName: The name of the release/album ReleaseName *string `json:"releaseName,omitempty" cborgen:"releaseName,omitempty"` // submissionClientAgent: A metadata string specifying the user agent where the format is `/ (; ; )`. If string is provided, only `app-identifier` and `version` are required. `app-identifier` is recommended to be in reverse dns format. Defaults to 'manual/unknown' if unavailable or not provided. SubmissionClientAgent *string `json:"submissionClientAgent,omitempty" cborgen:"submissionClientAgent,omitempty"` - // trackMbId: The Musicbrainz ID of the track + // trackDiscriminant: Distinguishing information for track variants (e.g. 'Acoustic Version', 'Live at Wembley', 'Radio Edit', 'Demo'). Used to differentiate between different versions of the same base track while maintaining grouping capabilities. + TrackDiscriminant *string `json:"trackDiscriminant,omitempty" cborgen:"trackDiscriminant,omitempty"` + // trackMbId: The MusicBrainz ID URI of the track, formatted as mbid: TrackMbId *string `json:"trackMbId,omitempty" cborgen:"trackMbId,omitempty"` // trackName: The name of the track TrackName string `json:"trackName" cborgen:"trackName"` diff --git a/api/teal/statsdefs.go b/api/teal/statsdefs.go new file mode 100644 index 0000000..a7ce7c3 --- /dev/null +++ b/api/teal/statsdefs.go @@ -0,0 +1,35 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package teal + +// schema: fm.teal.alpha.stats.defs + +// AlphaStatsDefs_ArtistView is a "artistView" in the fm.teal.alpha.stats.defs schema. +type AlphaStatsDefs_ArtistView struct { + // mbid: MusicBrainz artist ID URI, formatted as mbid: + Mbid *string `json:"mbid,omitempty" cborgen:"mbid,omitempty"` + // name: Artist name + Name *string `json:"name,omitempty" cborgen:"name,omitempty"` + // playCount: Total number of plays for this artist + PlayCount *int64 `json:"playCount,omitempty" cborgen:"playCount,omitempty"` +} + +// AlphaStatsDefs_RecordingView is a "recordingView" in the fm.teal.alpha.stats.defs schema. +type AlphaStatsDefs_RecordingView struct { + // mbid: MusicBrainz recording ID URI, formatted as mbid: + Mbid *string `json:"mbid,omitempty" cborgen:"mbid,omitempty"` + // name: Recording/track name + Name *string `json:"name,omitempty" cborgen:"name,omitempty"` + // playCount: Total number of plays for this recording + PlayCount *int64 `json:"playCount,omitempty" cborgen:"playCount,omitempty"` +} + +// AlphaStatsDefs_ReleaseView is a "releaseView" in the fm.teal.alpha.stats.defs schema. +type AlphaStatsDefs_ReleaseView struct { + // mbid: MusicBrainz release ID URI, formatted as mbid: + Mbid *string `json:"mbid,omitempty" cborgen:"mbid,omitempty"` + // name: Release/album name + Name *string `json:"name,omitempty" cborgen:"name,omitempty"` + // playCount: Total number of plays for this release + PlayCount *int64 `json:"playCount,omitempty" cborgen:"playCount,omitempty"` +} diff --git a/api/teal/statsgetLatest.go b/api/teal/statsgetLatest.go new file mode 100644 index 0000000..57e9d5c --- /dev/null +++ b/api/teal/statsgetLatest.go @@ -0,0 +1,33 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package teal + +// schema: fm.teal.alpha.stats.getLatest + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +// AlphaStatsGetLatest_Output is the output of a fm.teal.alpha.stats.getLatest call. +type AlphaStatsGetLatest_Output struct { + Plays []*AlphaFeedDefs_PlayView `json:"plays" cborgen:"plays"` +} + +// AlphaStatsGetLatest calls the XRPC method "fm.teal.alpha.stats.getLatest". +// +// limit: Number of latest plays to return +func AlphaStatsGetLatest(ctx context.Context, c util.LexClient, limit int64) (*AlphaStatsGetLatest_Output, error) { + var out AlphaStatsGetLatest_Output + + params := map[string]interface{}{} + if limit != 0 { + params["limit"] = limit + } + if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getLatest", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/teal/statsgetTopArtists.go b/api/teal/statsgetTopArtists.go new file mode 100644 index 0000000..a8d7dd7 --- /dev/null +++ b/api/teal/statsgetTopArtists.go @@ -0,0 +1,43 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package teal + +// schema: fm.teal.alpha.stats.getTopArtists + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +// AlphaStatsGetTopArtists_Output is the output of a fm.teal.alpha.stats.getTopArtists call. +type AlphaStatsGetTopArtists_Output struct { + Artists []*AlphaStatsDefs_ArtistView `json:"artists" cborgen:"artists"` + // cursor: Next page cursor + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` +} + +// AlphaStatsGetTopArtists calls the XRPC method "fm.teal.alpha.stats.getTopArtists". +// +// cursor: Pagination cursor +// limit: Number of artists to return +// period: Time period for top artists +func AlphaStatsGetTopArtists(ctx context.Context, c util.LexClient, cursor string, limit int64, period string) (*AlphaStatsGetTopArtists_Output, error) { + var out AlphaStatsGetTopArtists_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if period != "" { + params["period"] = period + } + if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getTopArtists", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/teal/statsgetTopReleases.go b/api/teal/statsgetTopReleases.go new file mode 100644 index 0000000..7e7cf40 --- /dev/null +++ b/api/teal/statsgetTopReleases.go @@ -0,0 +1,43 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package teal + +// schema: fm.teal.alpha.stats.getTopReleases + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +// AlphaStatsGetTopReleases_Output is the output of a fm.teal.alpha.stats.getTopReleases call. +type AlphaStatsGetTopReleases_Output struct { + // cursor: Next page cursor + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Releases []*AlphaStatsDefs_ReleaseView `json:"releases" cborgen:"releases"` +} + +// AlphaStatsGetTopReleases calls the XRPC method "fm.teal.alpha.stats.getTopReleases". +// +// cursor: Pagination cursor +// limit: Number of releases to return +// period: Time period for top releases +func AlphaStatsGetTopReleases(ctx context.Context, c util.LexClient, cursor string, limit int64, period string) (*AlphaStatsGetTopReleases_Output, error) { + var out AlphaStatsGetTopReleases_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if period != "" { + params["period"] = period + } + if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getTopReleases", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/teal/statsgetUserTopArtists.go b/api/teal/statsgetUserTopArtists.go new file mode 100644 index 0000000..0355fc4 --- /dev/null +++ b/api/teal/statsgetUserTopArtists.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package teal + +// schema: fm.teal.alpha.stats.getUserTopArtists + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +// AlphaStatsGetUserTopArtists_Output is the output of a fm.teal.alpha.stats.getUserTopArtists call. +type AlphaStatsGetUserTopArtists_Output struct { + Artists []*AlphaStatsDefs_ArtistView `json:"artists" cborgen:"artists"` + // cursor: Next page cursor + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` +} + +// AlphaStatsGetUserTopArtists calls the XRPC method "fm.teal.alpha.stats.getUserTopArtists". +// +// actor: The user's DID or handle +// cursor: Pagination cursor +// limit: Number of artists to return +// period: Time period for top artists +func AlphaStatsGetUserTopArtists(ctx context.Context, c util.LexClient, actor string, cursor string, limit int64, period string) (*AlphaStatsGetUserTopArtists_Output, error) { + var out AlphaStatsGetUserTopArtists_Output + + params := map[string]interface{}{} + params["actor"] = actor + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if period != "" { + params["period"] = period + } + if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getUserTopArtists", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/teal/statsgetUserTopReleases.go b/api/teal/statsgetUserTopReleases.go new file mode 100644 index 0000000..b09c861 --- /dev/null +++ b/api/teal/statsgetUserTopReleases.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package teal + +// schema: fm.teal.alpha.stats.getUserTopReleases + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +// AlphaStatsGetUserTopReleases_Output is the output of a fm.teal.alpha.stats.getUserTopReleases call. +type AlphaStatsGetUserTopReleases_Output struct { + // cursor: Next page cursor + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Releases []*AlphaStatsDefs_ReleaseView `json:"releases" cborgen:"releases"` +} + +// AlphaStatsGetUserTopReleases calls the XRPC method "fm.teal.alpha.stats.getUserTopReleases". +// +// actor: The user's DID or handle +// cursor: Pagination cursor +// limit: Number of releases to return +// period: Time period for top releases +func AlphaStatsGetUserTopReleases(ctx context.Context, c util.LexClient, actor string, cursor string, limit int64, period string) (*AlphaStatsGetUserTopReleases_Output, error) { + var out AlphaStatsGetUserTopReleases_Output + + params := map[string]interface{}{} + params["actor"] = actor + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if period != "" { + params["period"] = period + } + if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getUserTopReleases", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/cmd/lexgen/main.go b/cmd/lexgen/main.go index eabcd0b..7eb5d40 100644 --- a/cmd/lexgen/main.go +++ b/cmd/lexgen/main.go @@ -41,6 +41,7 @@ var modules = []moduleConfig{ cborTypes: []string{ "teal.AlphaFeedPlay", "teal.AlphaActorProfile", + "teal.AlphaActorProfileStatus", "teal.AlphaActorStatus", "teal.AlphaActorProfile_FeaturedItem", "teal.AlphaFeedDefs_PlayView", diff --git a/lexicons/teal/actor/defs.json b/lexicons/teal/actor/defs.json index 9ebdc45..1a2d912 100644 --- a/lexicons/teal/actor/defs.json +++ b/lexicons/teal/actor/defs.json @@ -34,6 +34,10 @@ "type": "string", "description": "IPLD of the banner image" }, + "status": { + "type": "ref", + "ref": "#statusView" + }, "createdAt": { "type": "string", "format": "datetime" } } }, @@ -55,6 +59,26 @@ "description": "IPLD of the avatar" } } + }, + "statusView": { + "type": "object", + "description": "A declaration of the status of the actor.", + "properties": { + "time": { + "type": "string", + "format": "datetime", + "description": "The unix timestamp of when the item was recorded" + }, + "expiry": { + "type": "string", + "format": "datetime", + "description": "The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time." + }, + "item": { + "type": "ref", + "ref": "fm.teal.alpha.feed.defs#playView" + } + } } } } diff --git a/lexicons/teal/actor/profile.json b/lexicons/teal/actor/profile.json index 66fab85..42e8350 100644 --- a/lexicons/teal/actor/profile.json +++ b/lexicons/teal/actor/profile.json @@ -52,7 +52,8 @@ "properties": { "mbid": { "type": "string", - "description": "The Musicbrainz ID of the item" + "format": "uri", + "description": "The MusicBrainz ID URI of the item, formatted as mbid:" }, "type": { "type": "string", diff --git a/lexicons/teal/actor/profileStatus.json b/lexicons/teal/actor/profileStatus.json new file mode 100644 index 0000000..da15287 --- /dev/null +++ b/lexicons/teal/actor/profileStatus.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "fm.teal.alpha.actor.profileStatus", + "defs": { + "main": { + "type": "record", + "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of the profile status of the actor.", + "key": "literal:self", + "record": { + "type": "object", + "required": ["completedOnboarding"], + "properties": { + "completedOnboarding": { + "type": "string", + "description": "The onboarding completion status", + "knownValues": ["none", "profileOnboarding", "playOnboarding", "complete"] + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "The timestamp when this status was created" + }, + "updatedAt": { + "type": "string", + "format": "datetime", + "description": "The timestamp when this status was last updated" + } + } + } + } + } +} diff --git a/lexicons/teal/actor/status.json b/lexicons/teal/actor/status.json index 33144d0..ff3761a 100644 --- a/lexicons/teal/actor/status.json +++ b/lexicons/teal/actor/status.json @@ -13,12 +13,12 @@ "time": { "type": "string", "format": "datetime", - "description": "The unix timestamp of when the item was recorded" + "description": "The RFC 3339 formatted time of when the item was recorded" }, "expiry": { "type": "string", "format": "datetime", - "description": "The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time." + "description": "The RFC 3339 formatted time of the expiry time of the item. If unavailable, default to 10 minutes past the start time." }, "item": { "type": "ref", diff --git a/lexicons/teal/feed/defs.json b/lexicons/teal/feed/defs.json index c4a90c4..ee26698 100644 --- a/lexicons/teal/feed/defs.json +++ b/lexicons/teal/feed/defs.json @@ -16,11 +16,13 @@ }, "trackMbId": { "type": "string", - "description": "The Musicbrainz ID of the track" + "format": "uri", + "description": "The MusicBrainz ID URI of the track, formatted as mbid:" }, "recordingMbId": { "type": "string", - "description": "The Musicbrainz recording ID of the track" + "format": "uri", + "description": "The MusicBrainz recording ID URI of the track, formatted as mbid:" }, "duration": { "type": "integer", @@ -42,7 +44,8 @@ }, "releaseMbId": { "type": "string", - "description": "The Musicbrainz release ID" + "format": "uri", + "description": "The MusicBrainz release ID URI, formatted as mbid:" }, "isrc": { "type": "string", @@ -82,7 +85,8 @@ }, "artistMbId": { "type": "string", - "description": "The Musicbrainz ID of the artist" + "format": "uri", + "description": "The MusicBrainz artist ID URI, formatted as mbid:" } } } diff --git a/lexicons/teal/feed/play.json b/lexicons/teal/feed/play.json index a9216b4..72df22c 100644 --- a/lexicons/teal/feed/play.json +++ b/lexicons/teal/feed/play.json @@ -19,12 +19,13 @@ }, "trackMbId": { "type": "string", - - "description": "The Musicbrainz ID of the track" + "format": "uri", + "description": "The MusicBrainz ID URI of the track, formatted as mbid:" }, "recordingMbId": { "type": "string", - "description": "The Musicbrainz recording ID of the track" + "format": "uri", + "description": "The MusicBrainz recording ID URI of the track, formatted as mbid:" }, "duration": { "type": "integer", @@ -38,14 +39,14 @@ "maxLength": 256, "maxGraphemes": 2560 }, - "description": "Array of artist names in order of original appearance. Prefer using 'artists'." + "description": "DEPRECATED: USE 'artists' INSTEAD. Array of artist names in order of original appearance." }, "artistMbIds": { "type": "array", "items": { "type": "string" }, - "description": "Array of Musicbrainz artist IDs. Prefer using 'artists'." + "description": "DEPRECATED: USE 'artists' INSTEAD. Array of Musicbrainz artist IDs." }, "artists": { "type": "array", @@ -63,7 +64,8 @@ }, "releaseMbId": { "type": "string", - "description": "The Musicbrainz release ID" + "format": "uri", + "description": "The MusicBrainz release ID URI, formatted as mbid:" }, "isrc": { "type": "string", @@ -87,6 +89,18 @@ "type": "string", "format": "datetime", "description": "The unix timestamp of when the track was played" + }, + "trackDiscriminant": { + "type": "string", + "maxLength": 128, + "maxGraphemes": 1280, + "description": "Distinguishing information for track variants (e.g. 'Acoustic Version', 'Live at Wembley', 'Radio Edit', 'Demo'). Used to differentiate between different versions of the same base track while maintaining grouping capabilities." + }, + "releaseDiscriminant": { + "type": "string", + "maxLength": 128, + "maxGraphemes": 1280, + "description": "Distinguishing information for release variants (e.g. 'Deluxe Edition', 'Remastered', '2023 Remaster', 'Special Edition'). Used to differentiate between different versions of the same base release while maintaining grouping capabilities." } } } diff --git a/lexicons/teal/stats/defs.json b/lexicons/teal/stats/defs.json new file mode 100644 index 0000000..8682a82 --- /dev/null +++ b/lexicons/teal/stats/defs.json @@ -0,0 +1,60 @@ +{ + "lexicon": 1, + "id": "fm.teal.alpha.stats.defs", + "defs": { + "artistView": { + "type": "object", + "properties": { + "mbid": { + "type": "string", + "format": "uri", + "description": "MusicBrainz artist ID URI, formatted as mbid:" + }, + "name": { + "type": "string", + "description": "Artist name" + }, + "playCount": { + "type": "integer", + "description": "Total number of plays for this artist" + } + } + }, + "releaseView": { + "type": "object", + "properties": { + "mbid": { + "type": "string", + "format": "uri", + "description": "MusicBrainz release ID URI, formatted as mbid:" + }, + "name": { + "type": "string", + "description": "Release/album name" + }, + "playCount": { + "type": "integer", + "description": "Total number of plays for this release" + } + } + }, + "recordingView": { + "type": "object", + "properties": { + "mbid": { + "type": "string", + "format": "uri", + "description": "MusicBrainz recording ID URI, formatted as mbid:" + }, + "name": { + "type": "string", + "description": "Recording/track name" + }, + "playCount": { + "type": "integer", + "description": "Total number of plays for this recording" + } + } + } + } +} diff --git a/lexicons/teal/stats/getLatest.json b/lexicons/teal/stats/getLatest.json new file mode 100644 index 0000000..aa9513c --- /dev/null +++ b/lexicons/teal/stats/getLatest.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "fm.teal.alpha.stats.getLatest", + "defs": { + "main": { + "type": "query", + "description": "Get latest plays globally", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50, + "description": "Number of latest plays to return" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["plays"], + "properties": { + "plays": { + "type": "array", + "items": { + "type": "ref", + "ref": "fm.teal.alpha.feed.defs#playView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/lexicons/teal/stats/getTopArtists.json b/lexicons/teal/stats/getTopArtists.json new file mode 100644 index 0000000..9d7dd85 --- /dev/null +++ b/lexicons/teal/stats/getTopArtists.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "fm.teal.alpha.stats.getTopArtists", + "description": "Get top artists by play count", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "properties": { + "period": { + "type": "string", + "enum": ["all", "30days", "7days"], + "default": "all", + "description": "Time period for top artists" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50, + "description": "Number of artists to return" + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["artists"], + "properties": { + "artists": { + "type": "array", + "items": { + "type": "ref", + "ref": "fm.teal.alpha.stats.defs#artistView" + } + }, + "cursor": { + "type": "string", + "description": "Next page cursor" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/lexicons/teal/stats/getTopReleases.json b/lexicons/teal/stats/getTopReleases.json new file mode 100644 index 0000000..349078b --- /dev/null +++ b/lexicons/teal/stats/getTopReleases.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "fm.teal.alpha.stats.getTopReleases", + "description": "Get top releases/albums by play count", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "properties": { + "period": { + "type": "string", + "enum": ["all", "30days", "7days"], + "default": "all", + "description": "Time period for top releases" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50, + "description": "Number of releases to return" + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["releases"], + "properties": { + "releases": { + "type": "array", + "items": { + "type": "ref", + "ref": "fm.teal.alpha.stats.defs#releaseView" + } + }, + "cursor": { + "type": "string", + "description": "Next page cursor" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/lexicons/teal/stats/getUserTopArtists.json b/lexicons/teal/stats/getUserTopArtists.json new file mode 100644 index 0000000..ab2092e --- /dev/null +++ b/lexicons/teal/stats/getUserTopArtists.json @@ -0,0 +1,58 @@ +{ + "lexicon": 1, + "id": "fm.teal.alpha.stats.getUserTopArtists", + "description": "Get a user's top artists by play count", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["actor"], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier", + "description": "The user's DID or handle" + }, + "period": { + "type": "string", + "enum": ["30days", "7days"], + "default": "30days", + "description": "Time period for top artists" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50, + "description": "Number of artists to return" + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["artists"], + "properties": { + "artists": { + "type": "array", + "items": { + "type": "ref", + "ref": "fm.teal.alpha.stats.defs#artistView" + } + }, + "cursor": { + "type": "string", + "description": "Next page cursor" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/lexicons/teal/stats/getUserTopReleases.json b/lexicons/teal/stats/getUserTopReleases.json new file mode 100644 index 0000000..1534ed2 --- /dev/null +++ b/lexicons/teal/stats/getUserTopReleases.json @@ -0,0 +1,58 @@ +{ + "lexicon": 1, + "id": "fm.teal.alpha.stats.getUserTopReleases", + "description": "Get a user's top releases/albums by play count", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["actor"], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier", + "description": "The user's DID or handle" + }, + "period": { + "type": "string", + "enum": ["30days", "7days"], + "default": "30days", + "description": "Time period for top releases" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50, + "description": "Number of releases to return" + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["releases"], + "properties": { + "releases": { + "type": "array", + "items": { + "type": "ref", + "ref": "fm.teal.alpha.stats.defs#releaseView" + } + }, + "cursor": { + "type": "string", + "description": "Next page cursor" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/models/lexicon_format.go b/models/lexicon_format.go new file mode 100644 index 0000000..aad670a --- /dev/null +++ b/models/lexicon_format.go @@ -0,0 +1,60 @@ +package models + +import ( + "net/url" + "strings" +) + +const mbidURIPrefix = "mbid:" + +var serviceDomainAliases = map[string]string{ + "apple": "music.apple.com", + "applemusic": "music.apple.com", + "lastfm": "last.fm", + "listenbrainz": "listenbrainz.org", + "spotify": "spotify.com", +} + +func FormatMBIDURI(id *string) *string { + if id == nil { + return nil + } + + trimmed := strings.TrimSpace(*id) + if trimmed == "" { + return nil + } + + if strings.HasPrefix(trimmed, mbidURIPrefix) { + return &trimmed + } + + formatted := mbidURIPrefix + trimmed + return &formatted +} + +func FormatMusicServiceBaseDomain(service string) *string { + trimmed := strings.TrimSpace(service) + if trimmed == "" { + return nil + } + + normalized := strings.ToLower(trimmed) + if alias, ok := serviceDomainAliases[normalized]; ok { + return &alias + } + + if strings.Contains(normalized, "://") { + parsed, err := url.Parse(normalized) + if err == nil && parsed.Hostname() != "" { + host := parsed.Hostname() + return &host + } + } + + if strings.Contains(normalized, "/") { + normalized = strings.SplitN(normalized, "/", 2)[0] + } + + return &normalized +} diff --git a/models/lexicon_format_test.go b/models/lexicon_format_test.go new file mode 100644 index 0000000..537d9b7 --- /dev/null +++ b/models/lexicon_format_test.go @@ -0,0 +1,63 @@ +package models + +import "testing" + +func TestFormatMBIDURI(t *testing.T) { + tests := []struct { + name string + in *string + want *string + }{ + {name: "nil"}, + {name: "empty", in: strPtr(" "), want: nil}, + {name: "plain", in: strPtr("98255a8c-017a-4bc7-8dd6-1fa36124572b"), want: strPtr("mbid:98255a8c-017a-4bc7-8dd6-1fa36124572b")}, + {name: "already uri", in: strPtr("mbid:98255a8c-017a-4bc7-8dd6-1fa36124572b"), want: strPtr("mbid:98255a8c-017a-4bc7-8dd6-1fa36124572b")}, + {name: "trim", in: strPtr(" 98255a8c-017a-4bc7-8dd6-1fa36124572b "), want: strPtr("mbid:98255a8c-017a-4bc7-8dd6-1fa36124572b")}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := FormatMBIDURI(tt.in) + assertStringPtr(t, got, tt.want) + }) + } +} + +func TestFormatMusicServiceBaseDomain(t *testing.T) { + tests := []struct { + name string + in string + want *string + }{ + {name: "empty"}, + {name: "alias", in: "spotify", want: strPtr("spotify.com")}, + {name: "lastfm alias", in: "lastfm", want: strPtr("last.fm")}, + {name: "url", in: "https://open.spotify.com/track/test", want: strPtr("open.spotify.com")}, + {name: "domain with path", in: "music.apple.com/us/album/test", want: strPtr("music.apple.com")}, + {name: "domain", in: "ListenBrainz.org", want: strPtr("listenbrainz.org")}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := FormatMusicServiceBaseDomain(tt.in) + assertStringPtr(t, got, tt.want) + }) + } +} + +func assertStringPtr(t *testing.T, got, want *string) { + t.Helper() + if got == nil || want == nil { + if got != want { + t.Fatalf("got %v, want %v", got, want) + } + return + } + if *got != *want { + t.Fatalf("got %q, want %q", *got, *want) + } +} + +func strPtr(s string) *string { + return &s +} diff --git a/service/atproto/submission.go b/service/atproto/submission.go index 7dfa819..608ebdf 100644 --- a/service/atproto/submission.go +++ b/service/atproto/submission.go @@ -58,7 +58,7 @@ func TrackToPlayRecord(track *models.Track) (*teal.AlphaFeedPlay, error) { for _, a := range track.Artist { artist := &teal.AlphaFeedDefs_Artist{ ArtistName: a.Name, - ArtistMbId: a.MBID, + ArtistMbId: models.FormatMBIDURI(a.MBID), } artists = append(artists, artist) } @@ -86,10 +86,7 @@ func TrackToPlayRecord(track *models.Track) (*teal.AlphaFeedPlay, error) { originUrlPtr = &track.URL } - var servicePtr *string - if track.ServiceBaseUrl != "" { - servicePtr = &track.ServiceBaseUrl - } + servicePtr := models.FormatMusicServiceBaseDomain(track.ServiceBaseUrl) var releaseNamePtr *string if track.Album != "" { @@ -108,8 +105,8 @@ func TrackToPlayRecord(track *models.Track) (*teal.AlphaFeedPlay, error) { Artists: artists, Duration: durationPtr, PlayedTime: playedTimeStr, - RecordingMbId: track.RecordingMBID, - ReleaseMbId: track.ReleaseMBID, + RecordingMbId: models.FormatMBIDURI(track.RecordingMBID), + ReleaseMbId: models.FormatMBIDURI(track.ReleaseMBID), ReleaseName: releaseNamePtr, Isrc: isrcPtr, OriginUrl: originUrlPtr, diff --git a/service/playingnow/playingnow.go b/service/playingnow/playingnow.go index ca8388d..318d442 100644 --- a/service/playingnow/playingnow.go +++ b/service/playingnow/playingnow.go @@ -228,7 +228,7 @@ func (p *Service) trackToPlayView(track *models.Track) (*teal.AlphaFeedDefs_Play for _, a := range track.Artist { artist := &teal.AlphaFeedDefs_Artist{ ArtistName: a.Name, - ArtistMbId: a.MBID, + ArtistMbId: models.FormatMBIDURI(a.MBID), } artists = append(artists, artist) } @@ -256,10 +256,7 @@ func (p *Service) trackToPlayView(track *models.Track) (*teal.AlphaFeedDefs_Play originUrlPtr = &track.URL } - var servicePtr *string - if track.ServiceBaseUrl != "" { - servicePtr = &track.ServiceBaseUrl - } + servicePtr := models.FormatMusicServiceBaseDomain(track.ServiceBaseUrl) var releaseNamePtr *string if track.Album != "" { @@ -277,8 +274,8 @@ func (p *Service) trackToPlayView(track *models.Track) (*teal.AlphaFeedDefs_Play Artists: artists, Duration: durationPtr, PlayedTime: playedTimeStr, - RecordingMbId: track.RecordingMBID, - ReleaseMbId: track.ReleaseMBID, + RecordingMbId: models.FormatMBIDURI(track.RecordingMBID), + ReleaseMbId: models.FormatMBIDURI(track.ReleaseMBID), ReleaseName: releaseNamePtr, Isrc: isrcPtr, OriginUrl: originUrlPtr, diff --git a/service/playingnow/playingnow_test.go b/service/playingnow/playingnow_test.go index c4ff740..d460ecd 100644 --- a/service/playingnow/playingnow_test.go +++ b/service/playingnow/playingnow_test.go @@ -62,7 +62,7 @@ func TestTrackToPlayView(t *testing.T) { if playView.Artists[0].ArtistName != "Test Artist" { t.Errorf("Expected artist name 'Test Artist', got %s", playView.Artists[0].ArtistName) } - if playView.Artists[0].ArtistMbId == nil || *playView.Artists[0].ArtistMbId != "test-artist-mbid" { + if playView.Artists[0].ArtistMbId == nil || *playView.Artists[0].ArtistMbId != "mbid:test-artist-mbid" { t.Errorf("Artist MBID not set correctly") } } @@ -75,11 +75,11 @@ func TestTrackToPlayView(t *testing.T) { t.Errorf("Expected duration 240 seconds, got %v", playView.Duration) } - if playView.RecordingMbId == nil || *playView.RecordingMbId != "test-recording-mbid" { + if playView.RecordingMbId == nil || *playView.RecordingMbId != "mbid:test-recording-mbid" { t.Errorf("Recording MBID not set correctly") } - if playView.ReleaseMbId == nil || *playView.ReleaseMbId != "test-release-mbid" { + if playView.ReleaseMbId == nil || *playView.ReleaseMbId != "mbid:test-release-mbid" { t.Errorf("Release MBID not set correctly") } @@ -91,7 +91,7 @@ func TestTrackToPlayView(t *testing.T) { t.Errorf("Origin URL not set correctly") } - if playView.MusicServiceBaseDomain == nil || *playView.MusicServiceBaseDomain != "spotify" { + if playView.MusicServiceBaseDomain == nil || *playView.MusicServiceBaseDomain != "spotify.com" { t.Errorf("Music service not set correctly") } } -- 2.51.2 From 41a00fb94f8aacf589ea92c6f89c282cd7711073 Mon Sep 17 00:00:00 2001 From: mmattbtw Date: Wed, 27 May 2026 22:16:05 -0500 Subject: [PATCH 2/2] Remove added teal lexicons and generated APIs --- api/teal/actorprofileStatus.go | 22 -- api/teal/cbor_gen.go | 245 -------------------- api/teal/statsdefs.go | 35 --- api/teal/statsgetLatest.go | 33 --- api/teal/statsgetTopArtists.go | 43 ---- api/teal/statsgetTopReleases.go | 43 ---- api/teal/statsgetUserTopArtists.go | 45 ---- api/teal/statsgetUserTopReleases.go | 45 ---- cmd/lexgen/main.go | 1 - lexicons/teal/actor/profileStatus.json | 32 --- lexicons/teal/stats/defs.json | 60 ----- lexicons/teal/stats/getLatest.json | 38 --- lexicons/teal/stats/getTopArtists.json | 52 ----- lexicons/teal/stats/getTopReleases.json | 52 ----- lexicons/teal/stats/getUserTopArtists.json | 58 ----- lexicons/teal/stats/getUserTopReleases.json | 58 ----- 16 files changed, 862 deletions(-) delete mode 100644 api/teal/actorprofileStatus.go delete mode 100644 api/teal/statsdefs.go delete mode 100644 api/teal/statsgetLatest.go delete mode 100644 api/teal/statsgetTopArtists.go delete mode 100644 api/teal/statsgetTopReleases.go delete mode 100644 api/teal/statsgetUserTopArtists.go delete mode 100644 api/teal/statsgetUserTopReleases.go delete mode 100644 lexicons/teal/actor/profileStatus.json delete mode 100644 lexicons/teal/stats/defs.json delete mode 100644 lexicons/teal/stats/getLatest.json delete mode 100644 lexicons/teal/stats/getTopArtists.json delete mode 100644 lexicons/teal/stats/getTopReleases.json delete mode 100644 lexicons/teal/stats/getUserTopArtists.json delete mode 100644 lexicons/teal/stats/getUserTopReleases.json diff --git a/api/teal/actorprofileStatus.go b/api/teal/actorprofileStatus.go deleted file mode 100644 index 2ad120d..0000000 --- a/api/teal/actorprofileStatus.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package teal - -import "github.com/bluesky-social/indigo/lex/util" - -// schema: fm.teal.alpha.actor.profileStatus - -// RECORDTYPE: AlphaActorProfileStatus -type AlphaActorProfileStatus struct { - LexiconTypeID string `json:"$type,const=fm.teal.alpha.actor.profileStatus" cborgen:"$type,const=fm.teal.alpha.actor.profileStatus"` - // completedOnboarding: The onboarding completion status - CompletedOnboarding string `json:"completedOnboarding" cborgen:"completedOnboarding"` - // createdAt: The timestamp when this status was created - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` - // updatedAt: The timestamp when this status was last updated - UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` -} - -func init() { - util.RegisterType("fm.teal.alpha.actor.profileStatus", &AlphaActorProfileStatus{}) -} diff --git a/api/teal/cbor_gen.go b/api/teal/cbor_gen.go index 7f13ec9..54c944e 100644 --- a/api/teal/cbor_gen.go +++ b/api/teal/cbor_gen.go @@ -1571,251 +1571,6 @@ func (t *AlphaActorProfile) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *AlphaActorProfileStatus) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - fieldCount := 4 - - if t.CreatedAt == nil { - fieldCount-- - } - - if t.UpdatedAt == nil { - fieldCount-- - } - - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { - return err - } - - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { - return err - } - if _, err := cw.WriteString(string("$type")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("fm.teal.alpha.actor.profileStatus"))); err != nil { - return err - } - if _, err := cw.WriteString(string("fm.teal.alpha.actor.profileStatus")); err != nil { - return err - } - - // t.CreatedAt (string) (string) - if t.CreatedAt != nil { - - if len("createdAt") > 1000000 { - return xerrors.Errorf("Value in field \"createdAt\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { - return err - } - if _, err := cw.WriteString(string("createdAt")); err != nil { - return err - } - - if t.CreatedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.CreatedAt) > 1000000 { - return xerrors.Errorf("Value in field t.CreatedAt was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil { - return err - } - } - } - - // t.UpdatedAt (string) (string) - if t.UpdatedAt != nil { - - if len("updatedAt") > 1000000 { - return xerrors.Errorf("Value in field \"updatedAt\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("updatedAt"))); err != nil { - return err - } - if _, err := cw.WriteString(string("updatedAt")); err != nil { - return err - } - - if t.UpdatedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.UpdatedAt) > 1000000 { - return xerrors.Errorf("Value in field t.UpdatedAt was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.UpdatedAt))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.UpdatedAt)); err != nil { - return err - } - } - } - - // t.CompletedOnboarding (string) (string) - if len("completedOnboarding") > 1000000 { - return xerrors.Errorf("Value in field \"completedOnboarding\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("completedOnboarding"))); err != nil { - return err - } - if _, err := cw.WriteString(string("completedOnboarding")); err != nil { - return err - } - - if len(t.CompletedOnboarding) > 1000000 { - return xerrors.Errorf("Value in field t.CompletedOnboarding was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CompletedOnboarding))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.CompletedOnboarding)); err != nil { - return err - } - return nil -} - -func (t *AlphaActorProfileStatus) UnmarshalCBOR(r io.Reader) (err error) { - *t = AlphaActorProfileStatus{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajMap { - return fmt.Errorf("cbor input should be of type map") - } - - if extra > cbg.MaxLength { - return fmt.Errorf("AlphaActorProfileStatus: map struct too large (%d)", extra) - } - - n := extra - - nameBuf := make([]byte, 19) - for i := uint64(0); i < n; i++ { - nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) - if err != nil { - return err - } - - if !ok { - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { - return err - } - continue - } - - switch string(nameBuf[:nameLen]) { - // t.LexiconTypeID (string) (string) - case "$type": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.LexiconTypeID = string(sval) - } - // t.CreatedAt (string) (string) - case "createdAt": - - { - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.CreatedAt = (*string)(&sval) - } - } - // t.UpdatedAt (string) (string) - case "updatedAt": - - { - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.UpdatedAt = (*string)(&sval) - } - } - // t.CompletedOnboarding (string) (string) - case "completedOnboarding": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.CompletedOnboarding = string(sval) - } - - default: - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { - return err - } - } - } - - return nil -} func (t *AlphaActorStatus) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) diff --git a/api/teal/statsdefs.go b/api/teal/statsdefs.go deleted file mode 100644 index a7ce7c3..0000000 --- a/api/teal/statsdefs.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package teal - -// schema: fm.teal.alpha.stats.defs - -// AlphaStatsDefs_ArtistView is a "artistView" in the fm.teal.alpha.stats.defs schema. -type AlphaStatsDefs_ArtistView struct { - // mbid: MusicBrainz artist ID URI, formatted as mbid: - Mbid *string `json:"mbid,omitempty" cborgen:"mbid,omitempty"` - // name: Artist name - Name *string `json:"name,omitempty" cborgen:"name,omitempty"` - // playCount: Total number of plays for this artist - PlayCount *int64 `json:"playCount,omitempty" cborgen:"playCount,omitempty"` -} - -// AlphaStatsDefs_RecordingView is a "recordingView" in the fm.teal.alpha.stats.defs schema. -type AlphaStatsDefs_RecordingView struct { - // mbid: MusicBrainz recording ID URI, formatted as mbid: - Mbid *string `json:"mbid,omitempty" cborgen:"mbid,omitempty"` - // name: Recording/track name - Name *string `json:"name,omitempty" cborgen:"name,omitempty"` - // playCount: Total number of plays for this recording - PlayCount *int64 `json:"playCount,omitempty" cborgen:"playCount,omitempty"` -} - -// AlphaStatsDefs_ReleaseView is a "releaseView" in the fm.teal.alpha.stats.defs schema. -type AlphaStatsDefs_ReleaseView struct { - // mbid: MusicBrainz release ID URI, formatted as mbid: - Mbid *string `json:"mbid,omitempty" cborgen:"mbid,omitempty"` - // name: Release/album name - Name *string `json:"name,omitempty" cborgen:"name,omitempty"` - // playCount: Total number of plays for this release - PlayCount *int64 `json:"playCount,omitempty" cborgen:"playCount,omitempty"` -} diff --git a/api/teal/statsgetLatest.go b/api/teal/statsgetLatest.go deleted file mode 100644 index 57e9d5c..0000000 --- a/api/teal/statsgetLatest.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package teal - -// schema: fm.teal.alpha.stats.getLatest - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -// AlphaStatsGetLatest_Output is the output of a fm.teal.alpha.stats.getLatest call. -type AlphaStatsGetLatest_Output struct { - Plays []*AlphaFeedDefs_PlayView `json:"plays" cborgen:"plays"` -} - -// AlphaStatsGetLatest calls the XRPC method "fm.teal.alpha.stats.getLatest". -// -// limit: Number of latest plays to return -func AlphaStatsGetLatest(ctx context.Context, c util.LexClient, limit int64) (*AlphaStatsGetLatest_Output, error) { - var out AlphaStatsGetLatest_Output - - params := map[string]interface{}{} - if limit != 0 { - params["limit"] = limit - } - if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getLatest", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/teal/statsgetTopArtists.go b/api/teal/statsgetTopArtists.go deleted file mode 100644 index a8d7dd7..0000000 --- a/api/teal/statsgetTopArtists.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package teal - -// schema: fm.teal.alpha.stats.getTopArtists - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -// AlphaStatsGetTopArtists_Output is the output of a fm.teal.alpha.stats.getTopArtists call. -type AlphaStatsGetTopArtists_Output struct { - Artists []*AlphaStatsDefs_ArtistView `json:"artists" cborgen:"artists"` - // cursor: Next page cursor - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` -} - -// AlphaStatsGetTopArtists calls the XRPC method "fm.teal.alpha.stats.getTopArtists". -// -// cursor: Pagination cursor -// limit: Number of artists to return -// period: Time period for top artists -func AlphaStatsGetTopArtists(ctx context.Context, c util.LexClient, cursor string, limit int64, period string) (*AlphaStatsGetTopArtists_Output, error) { - var out AlphaStatsGetTopArtists_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != 0 { - params["limit"] = limit - } - if period != "" { - params["period"] = period - } - if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getTopArtists", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/teal/statsgetTopReleases.go b/api/teal/statsgetTopReleases.go deleted file mode 100644 index 7e7cf40..0000000 --- a/api/teal/statsgetTopReleases.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package teal - -// schema: fm.teal.alpha.stats.getTopReleases - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -// AlphaStatsGetTopReleases_Output is the output of a fm.teal.alpha.stats.getTopReleases call. -type AlphaStatsGetTopReleases_Output struct { - // cursor: Next page cursor - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` - Releases []*AlphaStatsDefs_ReleaseView `json:"releases" cborgen:"releases"` -} - -// AlphaStatsGetTopReleases calls the XRPC method "fm.teal.alpha.stats.getTopReleases". -// -// cursor: Pagination cursor -// limit: Number of releases to return -// period: Time period for top releases -func AlphaStatsGetTopReleases(ctx context.Context, c util.LexClient, cursor string, limit int64, period string) (*AlphaStatsGetTopReleases_Output, error) { - var out AlphaStatsGetTopReleases_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != 0 { - params["limit"] = limit - } - if period != "" { - params["period"] = period - } - if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getTopReleases", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/teal/statsgetUserTopArtists.go b/api/teal/statsgetUserTopArtists.go deleted file mode 100644 index 0355fc4..0000000 --- a/api/teal/statsgetUserTopArtists.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package teal - -// schema: fm.teal.alpha.stats.getUserTopArtists - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -// AlphaStatsGetUserTopArtists_Output is the output of a fm.teal.alpha.stats.getUserTopArtists call. -type AlphaStatsGetUserTopArtists_Output struct { - Artists []*AlphaStatsDefs_ArtistView `json:"artists" cborgen:"artists"` - // cursor: Next page cursor - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` -} - -// AlphaStatsGetUserTopArtists calls the XRPC method "fm.teal.alpha.stats.getUserTopArtists". -// -// actor: The user's DID or handle -// cursor: Pagination cursor -// limit: Number of artists to return -// period: Time period for top artists -func AlphaStatsGetUserTopArtists(ctx context.Context, c util.LexClient, actor string, cursor string, limit int64, period string) (*AlphaStatsGetUserTopArtists_Output, error) { - var out AlphaStatsGetUserTopArtists_Output - - params := map[string]interface{}{} - params["actor"] = actor - if cursor != "" { - params["cursor"] = cursor - } - if limit != 0 { - params["limit"] = limit - } - if period != "" { - params["period"] = period - } - if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getUserTopArtists", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/teal/statsgetUserTopReleases.go b/api/teal/statsgetUserTopReleases.go deleted file mode 100644 index b09c861..0000000 --- a/api/teal/statsgetUserTopReleases.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package teal - -// schema: fm.teal.alpha.stats.getUserTopReleases - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -// AlphaStatsGetUserTopReleases_Output is the output of a fm.teal.alpha.stats.getUserTopReleases call. -type AlphaStatsGetUserTopReleases_Output struct { - // cursor: Next page cursor - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` - Releases []*AlphaStatsDefs_ReleaseView `json:"releases" cborgen:"releases"` -} - -// AlphaStatsGetUserTopReleases calls the XRPC method "fm.teal.alpha.stats.getUserTopReleases". -// -// actor: The user's DID or handle -// cursor: Pagination cursor -// limit: Number of releases to return -// period: Time period for top releases -func AlphaStatsGetUserTopReleases(ctx context.Context, c util.LexClient, actor string, cursor string, limit int64, period string) (*AlphaStatsGetUserTopReleases_Output, error) { - var out AlphaStatsGetUserTopReleases_Output - - params := map[string]interface{}{} - params["actor"] = actor - if cursor != "" { - params["cursor"] = cursor - } - if limit != 0 { - params["limit"] = limit - } - if period != "" { - params["period"] = period - } - if err := c.LexDo(ctx, util.Query, "", "fm.teal.alpha.stats.getUserTopReleases", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/cmd/lexgen/main.go b/cmd/lexgen/main.go index 7eb5d40..eabcd0b 100644 --- a/cmd/lexgen/main.go +++ b/cmd/lexgen/main.go @@ -41,7 +41,6 @@ var modules = []moduleConfig{ cborTypes: []string{ "teal.AlphaFeedPlay", "teal.AlphaActorProfile", - "teal.AlphaActorProfileStatus", "teal.AlphaActorStatus", "teal.AlphaActorProfile_FeaturedItem", "teal.AlphaFeedDefs_PlayView", diff --git a/lexicons/teal/actor/profileStatus.json b/lexicons/teal/actor/profileStatus.json deleted file mode 100644 index da15287..0000000 --- a/lexicons/teal/actor/profileStatus.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "lexicon": 1, - "id": "fm.teal.alpha.actor.profileStatus", - "defs": { - "main": { - "type": "record", - "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of the profile status of the actor.", - "key": "literal:self", - "record": { - "type": "object", - "required": ["completedOnboarding"], - "properties": { - "completedOnboarding": { - "type": "string", - "description": "The onboarding completion status", - "knownValues": ["none", "profileOnboarding", "playOnboarding", "complete"] - }, - "createdAt": { - "type": "string", - "format": "datetime", - "description": "The timestamp when this status was created" - }, - "updatedAt": { - "type": "string", - "format": "datetime", - "description": "The timestamp when this status was last updated" - } - } - } - } - } -} diff --git a/lexicons/teal/stats/defs.json b/lexicons/teal/stats/defs.json deleted file mode 100644 index 8682a82..0000000 --- a/lexicons/teal/stats/defs.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "lexicon": 1, - "id": "fm.teal.alpha.stats.defs", - "defs": { - "artistView": { - "type": "object", - "properties": { - "mbid": { - "type": "string", - "format": "uri", - "description": "MusicBrainz artist ID URI, formatted as mbid:" - }, - "name": { - "type": "string", - "description": "Artist name" - }, - "playCount": { - "type": "integer", - "description": "Total number of plays for this artist" - } - } - }, - "releaseView": { - "type": "object", - "properties": { - "mbid": { - "type": "string", - "format": "uri", - "description": "MusicBrainz release ID URI, formatted as mbid:" - }, - "name": { - "type": "string", - "description": "Release/album name" - }, - "playCount": { - "type": "integer", - "description": "Total number of plays for this release" - } - } - }, - "recordingView": { - "type": "object", - "properties": { - "mbid": { - "type": "string", - "format": "uri", - "description": "MusicBrainz recording ID URI, formatted as mbid:" - }, - "name": { - "type": "string", - "description": "Recording/track name" - }, - "playCount": { - "type": "integer", - "description": "Total number of plays for this recording" - } - } - } - } -} diff --git a/lexicons/teal/stats/getLatest.json b/lexicons/teal/stats/getLatest.json deleted file mode 100644 index aa9513c..0000000 --- a/lexicons/teal/stats/getLatest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "lexicon": 1, - "id": "fm.teal.alpha.stats.getLatest", - "defs": { - "main": { - "type": "query", - "description": "Get latest plays globally", - "parameters": { - "type": "params", - "properties": { - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "default": 50, - "description": "Number of latest plays to return" - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["plays"], - "properties": { - "plays": { - "type": "array", - "items": { - "type": "ref", - "ref": "fm.teal.alpha.feed.defs#playView" - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/lexicons/teal/stats/getTopArtists.json b/lexicons/teal/stats/getTopArtists.json deleted file mode 100644 index 9d7dd85..0000000 --- a/lexicons/teal/stats/getTopArtists.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "lexicon": 1, - "id": "fm.teal.alpha.stats.getTopArtists", - "description": "Get top artists by play count", - "defs": { - "main": { - "type": "query", - "parameters": { - "type": "params", - "properties": { - "period": { - "type": "string", - "enum": ["all", "30days", "7days"], - "default": "all", - "description": "Time period for top artists" - }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "default": 50, - "description": "Number of artists to return" - }, - "cursor": { - "type": "string", - "description": "Pagination cursor" - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["artists"], - "properties": { - "artists": { - "type": "array", - "items": { - "type": "ref", - "ref": "fm.teal.alpha.stats.defs#artistView" - } - }, - "cursor": { - "type": "string", - "description": "Next page cursor" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/lexicons/teal/stats/getTopReleases.json b/lexicons/teal/stats/getTopReleases.json deleted file mode 100644 index 349078b..0000000 --- a/lexicons/teal/stats/getTopReleases.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "lexicon": 1, - "id": "fm.teal.alpha.stats.getTopReleases", - "description": "Get top releases/albums by play count", - "defs": { - "main": { - "type": "query", - "parameters": { - "type": "params", - "properties": { - "period": { - "type": "string", - "enum": ["all", "30days", "7days"], - "default": "all", - "description": "Time period for top releases" - }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "default": 50, - "description": "Number of releases to return" - }, - "cursor": { - "type": "string", - "description": "Pagination cursor" - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["releases"], - "properties": { - "releases": { - "type": "array", - "items": { - "type": "ref", - "ref": "fm.teal.alpha.stats.defs#releaseView" - } - }, - "cursor": { - "type": "string", - "description": "Next page cursor" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/lexicons/teal/stats/getUserTopArtists.json b/lexicons/teal/stats/getUserTopArtists.json deleted file mode 100644 index ab2092e..0000000 --- a/lexicons/teal/stats/getUserTopArtists.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "lexicon": 1, - "id": "fm.teal.alpha.stats.getUserTopArtists", - "description": "Get a user's top artists by play count", - "defs": { - "main": { - "type": "query", - "parameters": { - "type": "params", - "required": ["actor"], - "properties": { - "actor": { - "type": "string", - "format": "at-identifier", - "description": "The user's DID or handle" - }, - "period": { - "type": "string", - "enum": ["30days", "7days"], - "default": "30days", - "description": "Time period for top artists" - }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "default": 50, - "description": "Number of artists to return" - }, - "cursor": { - "type": "string", - "description": "Pagination cursor" - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["artists"], - "properties": { - "artists": { - "type": "array", - "items": { - "type": "ref", - "ref": "fm.teal.alpha.stats.defs#artistView" - } - }, - "cursor": { - "type": "string", - "description": "Next page cursor" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/lexicons/teal/stats/getUserTopReleases.json b/lexicons/teal/stats/getUserTopReleases.json deleted file mode 100644 index 1534ed2..0000000 --- a/lexicons/teal/stats/getUserTopReleases.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "lexicon": 1, - "id": "fm.teal.alpha.stats.getUserTopReleases", - "description": "Get a user's top releases/albums by play count", - "defs": { - "main": { - "type": "query", - "parameters": { - "type": "params", - "required": ["actor"], - "properties": { - "actor": { - "type": "string", - "format": "at-identifier", - "description": "The user's DID or handle" - }, - "period": { - "type": "string", - "enum": ["30days", "7days"], - "default": "30days", - "description": "Time period for top releases" - }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "default": 50, - "description": "Number of releases to return" - }, - "cursor": { - "type": "string", - "description": "Pagination cursor" - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["releases"], - "properties": { - "releases": { - "type": "array", - "items": { - "type": "ref", - "ref": "fm.teal.alpha.stats.defs#releaseView" - } - }, - "cursor": { - "type": "string", - "description": "Next page cursor" - } - } - } - } - } - } -} \ No newline at end of file