add fallback for artist Top Tracks when server returns none

This commit is contained in:
Drew Weymouth
2024-06-26 08:28:24 -07:00
parent d9cec2e493
commit 2b39c6ba66
3 changed files with 21 additions and 0 deletions
@@ -248,6 +248,9 @@ func (s *subsonicMediaProvider) GetTopTracks(artist mediaprovider.Artist, count
if err != nil {
return nil, err
}
if len(tr) == 0 {
return helpers.GetTopTracksFallback(s, artist.ID, count)
}
return sharedutil.MapSlice(tr, toTrack), nil
}