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

@ -75,7 +75,7 @@ func (b *SpotifyHistoryBackend) InitConfig(config *config.ServiceConfig) error {
func (b *SpotifyHistoryBackend) ExportListens(oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.Progress) {
files, err := filepath.Glob(path.Join(b.dirPath, historyFileGlob))
if err != nil {
progress <- models.Progress{}.Complete()
progress <- models.Progress{}.Abort()
results <- models.ListensResult{Error: err}
return
}
@ -86,7 +86,7 @@ func (b *SpotifyHistoryBackend) ExportListens(oldestTimestamp time.Time, results
for i, filePath := range files {
history, err := readHistoryFile(filePath)
if err != nil {
progress <- models.Progress{}.Complete()
progress <- models.Progress{}.Abort()
results <- models.ListensResult{Error: err}
return
}