Close export results channel in generic implementation

This removes the need for every implementation to handle this case.
This commit is contained in:
Philipp Wolfer 2025-05-02 08:43:30 +02:00
parent 16245e495d
commit 5fb1596d61
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
11 changed files with 5 additions and 32 deletions

View file

@ -81,8 +81,6 @@ func (b *ListenBrainzApiBackend) ExportListens(oldestTimestamp time.Time, result
totalDuration := startTime.Sub(minTime)
defer close(results)
p := models.Progress{Total: int64(totalDuration.Seconds())}
for {
@ -195,7 +193,6 @@ func (b *ListenBrainzApiBackend) ImportListens(export models.ListensResult, impo
}
func (b *ListenBrainzApiBackend) ExportLoves(oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.Progress) {
defer close(results)
exportChan := make(chan models.LovesResult)
p := models.Progress{}