add duration to album info

This commit is contained in:
Kendall Garner 2026-01-26 19:25:29 -08:00
parent 2be6d65619
commit 3dfe4eee92
No known key found for this signature in database
GPG Key ID: 9355F387FE765C94
4 changed files with 8 additions and 0 deletions

View File

@ -151,6 +151,7 @@ func (l *listenBrainzAgent) GetArtistTopSongs(ctx context.Context, id, artistNam
AlbumMBID: t.ReleaseMBID,
Artist: t.ArtistName,
ArtistMBID: mbid,
Duration: t.DurationMs,
Name: t.RecordingName,
MBID: t.RecordingMbid,
}

View File

@ -256,6 +256,7 @@ var _ = Describe("listenBrainzAgent", func() {
ArtistMBID: "d2a92ee2-27ce-4e71-bfc5-12e34fe8ef56",
Album: "Miracle Milk",
AlbumMBID: "38a8f6e1-0e34-4418-a89d-78240a367408",
Duration: 211912,
},
{
ID: "",
@ -265,6 +266,7 @@ var _ = Describe("listenBrainzAgent", func() {
ArtistMBID: "d2a92ee2-27ce-4e71-bfc5-12e34fe8ef56",
Album: "String Theocracy",
AlbumMBID: "d79a38e3-7016-4f39-a31a-f495ce914b8e",
Duration: 174000,
},
}))
})
@ -283,6 +285,7 @@ var _ = Describe("listenBrainzAgent", func() {
ArtistMBID: "d2a92ee2-27ce-4e71-bfc5-12e34fe8ef56",
Album: "Miracle Milk",
AlbumMBID: "38a8f6e1-0e34-4418-a89d-78240a367408",
Duration: 211912,
},
}))
})

View File

@ -255,6 +255,7 @@ func (c *client) getArtistUrl(ctx context.Context, mbid string) (string, error)
type trackInfo struct {
ArtistName string `json:"artist_name"`
ArtistMBIDs []string `json:"artist_mbids"`
DurationMs uint32 `json:"length"`
RecordingName string `json:"recording_name"`
RecordingMbid string `json:"recording_mbid"`
ReleaseName string `json:"release_name"`

View File

@ -202,6 +202,7 @@ var _ = Describe("client", func() {
{
ArtistName: "Mili",
ArtistMBIDs: []string{"d2a92ee2-27ce-4e71-bfc5-12e34fe8ef56"},
DurationMs: 211912,
RecordingName: "world.execute(me);",
RecordingMbid: "9980309d-3480-4e7e-89ce-fce971a452be",
ReleaseName: "Miracle Milk",
@ -210,6 +211,7 @@ var _ = Describe("client", func() {
{
ArtistName: "Mili",
ArtistMBIDs: []string{"d2a92ee2-27ce-4e71-bfc5-12e34fe8ef56"},
DurationMs: 174000,
RecordingName: "String Theocracy",
RecordingMbid: "afa2c83d-b17f-4029-b9da-790ea9250cf9",
ReleaseName: "String Theocracy",
@ -230,6 +232,7 @@ var _ = Describe("client", func() {
{
ArtistName: "Mili",
ArtistMBIDs: []string{"d2a92ee2-27ce-4e71-bfc5-12e34fe8ef56"},
DurationMs: 211912,
RecordingName: "world.execute(me);",
RecordingMbid: "9980309d-3480-4e7e-89ce-fce971a452be",
ReleaseName: "Miracle Milk",