mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
Replaced ImportResult.ImportErrors with ImportResult.ImportLog
This commit is contained in:
parent
91f9b62db3
commit
8a2ddb7772
5 changed files with 55 additions and 13 deletions
|
@ -236,7 +236,7 @@ func (b *LastfmApiBackend) ImportListens(export models.ListensResult, importResu
|
|||
for _, s := range result.Scrobbles {
|
||||
ignoreMsg := s.IgnoredMessage.Body
|
||||
if ignoreMsg != "" {
|
||||
importResult.ImportErrors = append(importResult.ImportErrors, ignoreMsg)
|
||||
importResult.Log(models.Warning, ignoreMsg)
|
||||
}
|
||||
}
|
||||
err := fmt.Errorf("last.fm import ignored %v scrobbles", count-accepted)
|
||||
|
@ -335,7 +335,7 @@ func (b *LastfmApiBackend) ImportLoves(export models.LovesResult, importResult m
|
|||
} else {
|
||||
msg := fmt.Sprintf("Failed import of \"%s\" by %s: %v",
|
||||
love.TrackName, love.ArtistName(), err.Error())
|
||||
importResult.ImportErrors = append(importResult.ImportErrors, msg)
|
||||
importResult.Log(models.Error, msg)
|
||||
}
|
||||
|
||||
progress <- models.Progress{}.FromImportResult(importResult)
|
||||
|
|
|
@ -148,7 +148,7 @@ func (b *ListenBrainzApiBackend) ImportListens(export models.ListensResult, impo
|
|||
count -= 1
|
||||
msg := i18n.Tr("Ignored duplicate listen %v: \"%v\" by %v (%v)",
|
||||
l.ListenedAt, l.TrackName, l.ArtistName(), l.RecordingMbid)
|
||||
importResult.ImportErrors = append(importResult.ImportErrors, msg)
|
||||
importResult.Log(models.Info, msg)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ func (b *ListenBrainzApiBackend) ImportLoves(export models.LovesResult, importRe
|
|||
} else {
|
||||
msg := fmt.Sprintf("Failed import of \"%s\" by %s: %v",
|
||||
love.TrackName, love.ArtistName(), errMsg)
|
||||
importResult.ImportErrors = append(importResult.ImportErrors, msg)
|
||||
importResult.Log(models.Error, msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue