Show progress bars as aborted on export / import error

This commit is contained in:
Philipp Wolfer 2025-05-04 12:59:40 +02:00
parent 15d939e150
commit aae5123c3d
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
12 changed files with 35 additions and 21 deletions

View file

@ -86,7 +86,7 @@ func (b *ListenBrainzApiBackend) ExportListens(oldestTimestamp time.Time, result
for {
result, err := b.client.GetListens(b.username, time.Now(), minTime)
if err != nil {
progress <- p.Complete()
progress <- p.Abort()
results <- models.ListensResult{Error: err}
return
}
@ -199,8 +199,9 @@ func (b *ListenBrainzApiBackend) ExportLoves(oldestTimestamp time.Time, results
go b.exportLoves(oldestTimestamp, exportChan)
for existingLoves := range exportChan {
if existingLoves.Error != nil {
progress <- p.Complete()
progress <- p.Abort()
results <- models.LovesResult{Error: existingLoves.Error}
return
}
p.Total = int64(existingLoves.Total)