mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-10 10:17:04 +02:00
If import fails still save the last reported timestamp
This allows continuing a partially failed import run.
This commit is contained in:
parent
45aeeb7087
commit
1a9f9bb36c
3 changed files with 15 additions and 15 deletions
|
@ -105,6 +105,7 @@ out:
|
|||
}
|
||||
|
||||
func (b *MalojaApiBackend) ImportListens(export models.ListensResult, importResult models.ImportResult, progress chan models.Progress) (models.ImportResult, error) {
|
||||
p := models.Progress{}.FromImportResult(importResult)
|
||||
for _, listen := range export.Items {
|
||||
scrobble := NewScrobble{
|
||||
Title: listen.TrackName,
|
||||
|
@ -125,7 +126,7 @@ func (b *MalojaApiBackend) ImportListens(export models.ListensResult, importResu
|
|||
|
||||
importResult.UpdateTimestamp(listen.ListenedAt)
|
||||
importResult.ImportCount += 1
|
||||
progress <- models.Progress{}.FromImportResult(importResult)
|
||||
progress <- p.FromImportResult(importResult)
|
||||
}
|
||||
|
||||
return importResult, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue