mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Use mbtypes.ISRC type
This commit is contained in:
parent
ad1644672c
commit
13eb8342ab
7 changed files with 16 additions and 11 deletions
|
@ -22,6 +22,8 @@ THE SOFTWARE.
|
|||
|
||||
package spotify
|
||||
|
||||
import "go.uploadedlobster.com/mbtypes"
|
||||
|
||||
type TracksResult struct {
|
||||
Href string `json:"href"`
|
||||
Limit int `json:"limit"`
|
||||
|
@ -98,9 +100,9 @@ type Artist struct {
|
|||
}
|
||||
|
||||
type ExternalIds struct {
|
||||
ISRC string `json:"isrc"`
|
||||
EAN string `json:"ean"`
|
||||
UPC string `json:"upc"`
|
||||
ISRC mbtypes.ISRC `json:"isrc"`
|
||||
EAN string `json:"ean"`
|
||||
UPC string `json:"upc"`
|
||||
}
|
||||
|
||||
type ExternalUrls struct {
|
||||
|
|
|
@ -26,6 +26,7 @@ import (
|
|||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uploadedlobster.com/mbtypes"
|
||||
"go.uploadedlobster.com/scotty/internal/backends/spotify"
|
||||
"go.uploadedlobster.com/scotty/internal/config"
|
||||
)
|
||||
|
@ -59,7 +60,7 @@ func TestSpotifyListenAsListen(t *testing.T) {
|
|||
assert.Equal(t, []string{"Dool"}, listen.ArtistNames)
|
||||
assert.Equal(t, 5, listen.TrackNumber)
|
||||
assert.Equal(t, 1, listen.DiscNumber)
|
||||
assert.Equal(t, "DES561620801", listen.ISRC)
|
||||
assert.Equal(t, mbtypes.ISRC("DES561620801"), listen.ISRC)
|
||||
info := listen.AdditionalInfo
|
||||
assert.Equal(t, "spotify.com", info["music_service"])
|
||||
assert.Equal(t, "https://open.spotify.com/track/2JKUgGuXK3dEvyuIJ4Yj2V", info["origin_url"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue