mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Use MBID type from go.uploadedlobster.com/mbtypes
This commit is contained in:
parent
04eddfda33
commit
8fff19ceac
12 changed files with 82 additions and 188 deletions
|
@ -24,9 +24,10 @@ package models
|
|||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.uploadedlobster.com/mbtypes"
|
||||
)
|
||||
|
||||
type MBID string
|
||||
type Entity string
|
||||
|
||||
const (
|
||||
|
@ -44,11 +45,11 @@ type Track struct {
|
|||
DiscNumber int
|
||||
Duration time.Duration
|
||||
ISRC string
|
||||
RecordingMbid MBID
|
||||
ReleaseMbid MBID
|
||||
ReleaseGroupMbid MBID
|
||||
ArtistMbids []MBID
|
||||
WorkMbids []MBID
|
||||
RecordingMbid mbtypes.MBID
|
||||
ReleaseMbid mbtypes.MBID
|
||||
ReleaseGroupMbid mbtypes.MBID
|
||||
ArtistMbids []mbtypes.MBID
|
||||
WorkMbids []mbtypes.MBID
|
||||
Tags []string
|
||||
AdditionalInfo AdditionalInfo
|
||||
}
|
||||
|
@ -110,8 +111,8 @@ type Love struct {
|
|||
Track
|
||||
Created time.Time
|
||||
UserName string
|
||||
RecordingMbid MBID
|
||||
RecordingMsid MBID
|
||||
RecordingMbid mbtypes.MBID
|
||||
RecordingMsid mbtypes.MBID
|
||||
}
|
||||
|
||||
type ListensList []Listen
|
||||
|
|
|
@ -28,6 +28,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uploadedlobster.com/mbtypes"
|
||||
"go.uploadedlobster.com/scotty/internal/models"
|
||||
)
|
||||
|
||||
|
@ -44,11 +45,11 @@ func TestTrackArtistName(t *testing.T) {
|
|||
|
||||
func TestTrackFillAdditionalInfo(t *testing.T) {
|
||||
track := models.Track{
|
||||
RecordingMbid: models.MBID("c0a1fc94-5f04-4a5f-bc09-e5de0c49cd12"),
|
||||
ReleaseGroupMbid: models.MBID("80aca1ee-aa51-41be-9f75-024710d92ff4"),
|
||||
ReleaseMbid: models.MBID("aa1ea1ac-7ec4-4542-a494-105afbfe547d"),
|
||||
ArtistMbids: []models.MBID{"24412926-c7bd-48e8-afad-8a285b42e131"},
|
||||
WorkMbids: []models.MBID{"c0a1fc94-5f04-4a5f-bc09-e5de0c49cd12"},
|
||||
RecordingMbid: mbtypes.MBID("c0a1fc94-5f04-4a5f-bc09-e5de0c49cd12"),
|
||||
ReleaseGroupMbid: mbtypes.MBID("80aca1ee-aa51-41be-9f75-024710d92ff4"),
|
||||
ReleaseMbid: mbtypes.MBID("aa1ea1ac-7ec4-4542-a494-105afbfe547d"),
|
||||
ArtistMbids: []mbtypes.MBID{"24412926-c7bd-48e8-afad-8a285b42e131"},
|
||||
WorkMbids: []mbtypes.MBID{"c0a1fc94-5f04-4a5f-bc09-e5de0c49cd12"},
|
||||
TrackNumber: 5,
|
||||
DiscNumber: 1,
|
||||
Duration: time.Duration(413787 * time.Millisecond),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue