mirror of
https://git.sr.ht/~phw/scotty
synced 2025-06-05 04:58:33 +02:00
Use LB API to lookup missing metadata for loves
This is faster than using the MBID API individually
This commit is contained in:
parent
dddd2e4eec
commit
7542657925
4 changed files with 194 additions and 51 deletions
|
@ -82,9 +82,9 @@ type MBIDMapping struct {
|
|||
}
|
||||
|
||||
type Artist struct {
|
||||
ArtistCreditName string `json:"artist_credit_name,omitempty"`
|
||||
ArtistMBID string `json:"artist_mbid,omitempty"`
|
||||
JoinPhrase string `json:"join_phrase,omitempty"`
|
||||
ArtistCreditName string `json:"artist_credit_name,omitempty"`
|
||||
ArtistMBID mbtypes.MBID `json:"artist_mbid,omitempty"`
|
||||
JoinPhrase string `json:"join_phrase,omitempty"`
|
||||
}
|
||||
|
||||
type GetFeedbackResult struct {
|
||||
|
@ -112,6 +112,44 @@ type LookupResult struct {
|
|||
ArtistMBIDs []mbtypes.MBID `json:"artist_mbids"`
|
||||
}
|
||||
|
||||
type RecordingMetadataRequest struct {
|
||||
RecordingMBIDs []mbtypes.MBID `json:"recording_mbids"`
|
||||
Includes string `json:"inc,omitempty"`
|
||||
}
|
||||
|
||||
// Result for a recording metadata lookup
|
||||
type RecordingMetadataResult map[mbtypes.MBID]RecordingMetadata
|
||||
|
||||
type RecordingMetadata struct {
|
||||
Artist struct {
|
||||
Name string `json:"name"`
|
||||
ArtistCreditID int `json:"artist_credit_id"`
|
||||
Artists []struct {
|
||||
Name string `json:"name"`
|
||||
Area string `json:"area"`
|
||||
ArtistMBID mbtypes.MBID `json:"artist_mbid"`
|
||||
JoinPhrase string `json:"join_phrase"`
|
||||
BeginYear int `json:"begin_year"`
|
||||
Type string `json:"type"`
|
||||
// todo rels
|
||||
} `json:"artists"`
|
||||
} `json:"artist"`
|
||||
Recording struct {
|
||||
Name string `json:"name"`
|
||||
Length int `json:"length"`
|
||||
// TODO rels
|
||||
} `json:"recording"`
|
||||
Release struct {
|
||||
Name string `json:"name"`
|
||||
AlbumArtistName string `json:"album_artist_name"`
|
||||
Year int `json:"year"`
|
||||
MBID mbtypes.MBID `json:"mbid"`
|
||||
ReleaseGroupMBID mbtypes.MBID `json:"release_group_mbid"`
|
||||
CAAID int `json:"caa_id"`
|
||||
CAAReleaseMBID mbtypes.MBID `json:"caa_release_mbid"`
|
||||
} `json:"release"`
|
||||
}
|
||||
|
||||
type StatusResult struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue