From 54062bbc14e4a129f2a34763009cc48525738585 Mon Sep 17 00:00:00 2001 From: Lambada10 <62511588+Lambada10@users.noreply.github.com> Date: Tue, 30 Apr 2024 19:26:26 +0200 Subject: [PATCH] Netease: detect another "No results" cause --- .../songsync/data/remote/lyrics_providers/others/NeteaseAPI.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/NeteaseAPI.kt b/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/NeteaseAPI.kt index 47c8127..c46e22c 100644 --- a/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/NeteaseAPI.kt +++ b/app/src/main/java/pl/lambada/songsync/data/remote/lyrics_providers/others/NeteaseAPI.kt @@ -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 @@ -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