mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 13:47:05 +02:00
Add ImportResult.UpdateTimestamp method
This commit is contained in:
parent
298697dcfc
commit
729a3d0ed0
6 changed files with 39 additions and 30 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue