mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-07 21:48:18 -08:00
fix: strip sub-second precision from incoming listens
This commit is contained in:
parent
80b6f4deaa
commit
31d57fd79a
2 changed files with 4 additions and 1 deletions
|
|
@ -71,6 +71,9 @@ func SubmitListen(ctx context.Context, store db.DB, opts SubmitListenOpts) error
|
|||
return errors.New("track name and artist are required")
|
||||
}
|
||||
|
||||
// bandaid to ensure new activity does not have sub-second precision
|
||||
opts.Time = opts.Time.Truncate(time.Second)
|
||||
|
||||
artists, err := AssociateArtists(
|
||||
ctx,
|
||||
store,
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ func TestSubmitListen_CreateAllMbzIDs(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
require.Len(t, p.Items, 1)
|
||||
l := p.Items[0]
|
||||
EqualTime(t, opts.Time, l.Time)
|
||||
EqualTime(t, opts.Time.Truncate(time.Second), l.Time)
|
||||
}
|
||||
|
||||
func TestSubmitListen_CreateAllMbzIDsNoReleaseGroupID(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue