Merge pull request #191 from natilou/download-track

Ability to download tracks
This commit is contained in:
Drew Weymouth
2023-06-16 17:51:49 -07:00
committed by GitHub
6 changed files with 122 additions and 2 deletions
+6 -1
View File
@@ -1,6 +1,9 @@
package mediaprovider
import "image"
import (
"image"
"io"
)
type AlbumFilter struct {
MinYear int
@@ -83,4 +86,6 @@ type MediaProvider interface {
DeletePlaylist(id string) error
Scrobble(trackID string, submission bool) error
DownloadTrack(trackID string) (io.Reader, error)
}
@@ -3,6 +3,7 @@ package subsonic
import (
"errors"
"image"
"io"
"math"
"strconv"
"sync"
@@ -249,6 +250,10 @@ func (s *subsonicMediaProvider) SetRating(params mediaprovider.RatingFavoritePar
return err
}
func (s *subsonicMediaProvider) DownloadTrack(trackID string) (io.Reader, error) {
return s.client.Download(trackID)
}
func toTrack(ch *subsonic.Child) *mediaprovider.Track {
if ch == nil {
return nil