fix: ensure importers are using UTC

pull/20/head
Gabe Farrell 6 months ago
parent 330f0061f0
commit e1fcc5d5f4

@ -88,7 +88,7 @@ func ImportLastFMFile(ctx context.Context, store db.DB, mbzc mbz.MusicBrainzCall
if err != nil {
ts, err = time.Parse("02 Jan 2006, 15:04", track.Date.Text)
if err != nil {
ts = time.Now()
ts = time.Now().UTC()
}
} else {
ts = time.Unix(unix, 0).UTC()

@ -22,12 +22,6 @@ import (
"github.com/google/uuid"
)
// first, unzip zip file with name "listenbrainz_username_unix.zip"
// then, enter the listens folder
// then, recursively traverse all files in folder
// then, import all .jsonl files found in folders
// then, cleanup folder recursively
// finally, move zip to complete dir
func ImportListenBrainzExport(ctx context.Context, store db.DB, mbzc mbz.MusicBrainzCaller, filename string) error {
l := logger.FromContext(ctx)

@ -58,7 +58,7 @@ func ImportSpotifyFile(ctx context.Context, store db.DB, filename string) error
TrackTitle: item.TrackName,
ReleaseTitle: item.AlbumName,
Duration: dur / 1000,
Time: item.Timestamp,
Time: item.Timestamp.UTC(),
UserID: 1,
}
err = catalog.SubmitListen(ctx, store, opts)

Loading…
Cancel
Save