diff --git a/lib/API/musify.dart b/lib/API/musify.dart index 571de3c57..b8aaa35c3 100644 --- a/lib/API/musify.dart +++ b/lib/API/musify.dart @@ -336,10 +336,12 @@ Future>> getSkipSegments(String id) async { } Future getRandomSong() async { - const playlistId = 'PLgzTt0k8mXzEk586ze4BjvDXR7c-TUSnx'; - final playlistSongs = await getSongsFromPlaylist(playlistId); + if (globalSongs.isEmpty) { + const playlistId = 'PLgzTt0k8mXzEk586ze4BjvDXR7c-TUSnx'; + globalSongs = await getSongsFromPlaylist(playlistId); + } - return playlistSongs[random.nextInt(playlistSongs.length)]; + return globalSongs[random.nextInt(globalSongs.length)]; } Future getSongsFromPlaylist(dynamic playlistId) async {