mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-17 03:06:42 -07:00
feat: v0.0.5
This commit is contained in:
parent
4c4ebc593d
commit
242a82ad8c
36 changed files with 694 additions and 174 deletions
|
|
@ -29,24 +29,30 @@ type SaveListenOpts struct {
|
|||
Time time.Time
|
||||
}
|
||||
|
||||
type ArtistMbidMap struct {
|
||||
Artist string
|
||||
Mbid uuid.UUID
|
||||
}
|
||||
|
||||
type SubmitListenOpts struct {
|
||||
// When true, skips registering the listen and only associates or creates the
|
||||
// artist, release, release group, and track in DB
|
||||
SkipSaveListen bool
|
||||
|
||||
MbzCaller mbz.MusicBrainzCaller
|
||||
ArtistNames []string
|
||||
Artist string
|
||||
ArtistMbzIDs []uuid.UUID
|
||||
TrackTitle string
|
||||
RecordingMbzID uuid.UUID
|
||||
Duration int32 // in seconds
|
||||
ReleaseTitle string
|
||||
ReleaseMbzID uuid.UUID
|
||||
ReleaseGroupMbzID uuid.UUID
|
||||
Time time.Time
|
||||
UserID int32
|
||||
Client string
|
||||
MbzCaller mbz.MusicBrainzCaller
|
||||
ArtistNames []string
|
||||
Artist string
|
||||
ArtistMbzIDs []uuid.UUID
|
||||
ArtistMbidMappings []ArtistMbidMap
|
||||
TrackTitle string
|
||||
RecordingMbzID uuid.UUID
|
||||
Duration int32 // in seconds
|
||||
ReleaseTitle string
|
||||
ReleaseMbzID uuid.UUID
|
||||
ReleaseGroupMbzID uuid.UUID
|
||||
Time time.Time
|
||||
UserID int32
|
||||
Client string
|
||||
}
|
||||
|
||||
const (
|
||||
|
|
@ -64,11 +70,12 @@ func SubmitListen(ctx context.Context, store db.DB, opts SubmitListenOpts) error
|
|||
ctx,
|
||||
store,
|
||||
AssociateArtistsOpts{
|
||||
ArtistMbzIDs: opts.ArtistMbzIDs,
|
||||
ArtistNames: opts.ArtistNames,
|
||||
ArtistName: opts.Artist,
|
||||
Mbzc: opts.MbzCaller,
|
||||
TrackTitle: opts.TrackTitle,
|
||||
ArtistMbzIDs: opts.ArtistMbzIDs,
|
||||
ArtistNames: opts.ArtistNames,
|
||||
ArtistName: opts.Artist,
|
||||
ArtistMbidMap: opts.ArtistMbidMappings,
|
||||
Mbzc: opts.MbzCaller,
|
||||
TrackTitle: opts.TrackTitle,
|
||||
})
|
||||
if err != nil {
|
||||
l.Error().Err(err).Msg("Failed to associate artists to listen")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue