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
|
@ -23,6 +23,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/shkh/lastfm-go/lastfm"
|
||||
"go.uploadedlobster.com/mbtypes"
|
||||
"go.uploadedlobster.com/scotty/internal/auth"
|
||||
"go.uploadedlobster.com/scotty/internal/config"
|
||||
"go.uploadedlobster.com/scotty/internal/i18n"
|
||||
|
@ -140,16 +141,16 @@ out:
|
|||
TrackName: scrobble.Name,
|
||||
ArtistNames: []string{},
|
||||
ReleaseName: scrobble.Album.Name,
|
||||
RecordingMbid: models.MBID(scrobble.Mbid),
|
||||
ArtistMbids: []models.MBID{},
|
||||
ReleaseMbid: models.MBID(scrobble.Album.Mbid),
|
||||
RecordingMbid: mbtypes.MBID(scrobble.Mbid),
|
||||
ArtistMbids: []mbtypes.MBID{},
|
||||
ReleaseMbid: mbtypes.MBID(scrobble.Album.Mbid),
|
||||
},
|
||||
}
|
||||
if scrobble.Artist.Name != "" {
|
||||
listen.Track.ArtistNames = []string{scrobble.Artist.Name}
|
||||
}
|
||||
if scrobble.Artist.Mbid != "" {
|
||||
listen.Track.ArtistMbids = []models.MBID{models.MBID(scrobble.Artist.Mbid)}
|
||||
listen.Track.ArtistMbids = []mbtypes.MBID{mbtypes.MBID(scrobble.Artist.Mbid)}
|
||||
}
|
||||
listens = append(listens, listen)
|
||||
} else {
|
||||
|
@ -294,12 +295,12 @@ out:
|
|||
love := models.Love{
|
||||
Created: time.Unix(timestamp, 0),
|
||||
UserName: result.User,
|
||||
RecordingMbid: models.MBID(track.Mbid),
|
||||
RecordingMbid: mbtypes.MBID(track.Mbid),
|
||||
Track: models.Track{
|
||||
TrackName: track.Name,
|
||||
ArtistNames: []string{track.Artist.Name},
|
||||
RecordingMbid: models.MBID(track.Mbid),
|
||||
ArtistMbids: []models.MBID{models.MBID(track.Artist.Mbid)},
|
||||
RecordingMbid: mbtypes.MBID(track.Mbid),
|
||||
ArtistMbids: []mbtypes.MBID{mbtypes.MBID(track.Artist.Mbid)},
|
||||
AdditionalInfo: models.AdditionalInfo{
|
||||
"lastfm_url": track.Url,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue