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

@ -158,10 +158,8 @@ func (b ListenBrainzApiBackend) ImportLoves(loves []models.Love, oldestTimestamp
}
if ok {
result.UpdateTimestamp(love.Created)
result.ImportCount += 1
if love.Created.Unix() > result.LastTimestamp.Unix() {
result.LastTimestamp = love.Created
}
} else {
msg := fmt.Sprintf("Failed import of \"%s\" by %s: %v",
love.TrackName, love.ArtistName(), errMsg)