mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-15 10:25:55 -07: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")
|
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(
|
artists, err := AssociateArtists(
|
||||||
ctx,
|
ctx,
|
||||||
store,
|
store,
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ func TestSubmitListen_CreateAllMbzIDs(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, p.Items, 1)
|
require.Len(t, p.Items, 1)
|
||||||
l := p.Items[0]
|
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) {
|
func TestSubmitListen_CreateAllMbzIDsNoReleaseGroupID(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue