Skip to content

Commit 7a3f4a5

Browse files
committed
Fix: play song in playlist
1 parent 68a25ec commit 7a3f4a5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/components/options/OptionsArtist.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,15 @@ const OptionsArtist = ({ artist, artistInfo = {}, isOption, setIsOption }) => {
4040
const inPlaylist = []
4141

4242
const jsonPlaylists = await getApiCacheFirst(config, 'getPlaylists')
43-
if (!jsonPlaylists?.playlists?.playlist) return
43+
.catch(() => null)
44+
if (!jsonPlaylists?.playlists?.playlist) {
45+
refOption.current.close()
46+
return
47+
}
4448
for (const playlist of jsonPlaylists.playlists.playlist) {
4549
const jsonPlaylist = await getApiCacheFirst(config, 'getPlaylist', { id: playlist.id })
46-
if (!jsonPlaylist?.playlist?.entry) return
50+
.catch(() => null)
51+
if (!jsonPlaylist?.playlist?.entry) continue
4752
jsonPlaylist.playlist.entry.forEach(song => {
4853
if (song.artistId === artist.id && !inPlaylist.find(s => s.id === song.id)) {
4954
inPlaylist.push(song)

0 commit comments

Comments
 (0)