Skip to content

Commit

Permalink
Netease: detect another "No results" cause
Browse files Browse the repository at this point in the history
  • Loading branch information
Lambada10 committed Apr 30, 2024
1 parent b3abc76 commit 54062bb
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import kotlinx.coroutines.withContext
import kotlinx.serialization.ExperimentalSerializationApi
import pl.lambada.songsync.data.EmptyQueryException
import pl.lambada.songsync.data.InternalErrorException
import pl.lambada.songsync.data.NoTrackFoundException
import pl.lambada.songsync.domain.model.SongInfo
import pl.lambada.songsync.domain.model.lyrics_providers.others.NeteaseLyricsResponse
import pl.lambada.songsync.domain.model.lyrics_providers.others.NeteaseResponse
Expand Down Expand Up @@ -68,7 +67,7 @@ class NeteaseAPI {
}
val responseBody = response.bodyAsText(Charsets.UTF_8)

if (responseBody == "[]" || response.status.value !in 200..299)
if (responseBody == "[]" || response.status.value !in 200..299 || responseBody.contains("\"songCount\":0"))
return null

val neteaseResponse: NeteaseResponse
Expand Down

0 comments on commit 54062bb

Please sign in to comment.