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