Add ImportResult.UpdateTimestamp method

This commit is contained in:
Philipp Wolfer 2023-11-15 18:37:36 +01:00
parent 298697dcfc
commit 729a3d0ed0
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
6 changed files with 39 additions and 30 deletions

View file

@ -55,10 +55,6 @@ func (b JspfBackend) ImportLoves(loves []models.Love, oldestTimestamp time.Time)
tracks := make([]Track, 0, result.TotalCount)
for _, love := range loves {
if love.Created.Unix() > result.LastTimestamp.Unix() {
result.LastTimestamp = love.Created
}
extension := MusicBrainzTrackExtension{
AddedAt: love.Created,
AddedBy: love.UserName,
@ -90,6 +86,7 @@ func (b JspfBackend) ImportLoves(loves []models.Love, oldestTimestamp time.Time)
tracks = append(tracks, track)
result.UpdateTimestamp(love.Created)
result.ImportCount += 1
}