add similar songs fallback when server returns none
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
"github.com/dweymouth/go-subsonic/subsonic"
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider/helpers"
|
||||
"github.com/dweymouth/supersonic/sharedutil"
|
||||
)
|
||||
|
||||
@@ -622,5 +623,12 @@ func (s *subsonicMediaProvider) GetSongRadio(trackID string, count int) ([]*medi
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(tr) == 0 {
|
||||
track, err := s.GetTrack(trackID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return helpers.GetSimilarSongsFallback(s, track, count), nil
|
||||
}
|
||||
return sharedutil.MapSlice(tr, toTrack), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user