mirror of
https://git.sr.ht/~phw/scotty
synced 2025-07-02 00:01:56 +02:00
Show progress bars as aborted on export / import error
This commit is contained in:
parent
15d939e150
commit
aae5123c3d
12 changed files with 35 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue