mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 13:47:05 +02:00
Updated all import/export interfaces
This commit is contained in:
parent
729a3d0ed0
commit
ab04eb1123
12 changed files with 247 additions and 167 deletions
|
@ -48,23 +48,20 @@ func (b SubsonicApiBackend) FromConfig(config *viper.Viper) models.Backend {
|
|||
}
|
||||
|
||||
func (b SubsonicApiBackend) ExportLoves(oldestTimestamp time.Time, results chan models.LovesResult) {
|
||||
defer close(results)
|
||||
err := b.client.Authenticate(b.password)
|
||||
if err != nil {
|
||||
results <- models.LovesResult{Error: err}
|
||||
close(results)
|
||||
return
|
||||
}
|
||||
|
||||
starred, err := b.client.GetStarred2(map[string]string{})
|
||||
if err != nil {
|
||||
results <- models.LovesResult{Error: err}
|
||||
close(results)
|
||||
return
|
||||
}
|
||||
|
||||
results <- models.LovesResult{Loves: b.filterSongs(starred.Song, oldestTimestamp)}
|
||||
close(results)
|
||||
return
|
||||
}
|
||||
|
||||
func (b SubsonicApiBackend) filterSongs(songs []*subsonic.Child, oldestTimestamp time.Time) models.LovesList {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue