Skip to content

Commit

Permalink
fix: remove unnecessary manul escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Risuntsy committed Jul 29, 2024
1 parent ee3ee40 commit 7f13824
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,9 @@ class NeteaseAPI {
*/
@OptIn(ExperimentalSerializationApi::class)
suspend fun getSongInfo(query: SongInfo, offset: Int? = 0): SongInfo? {
val search = withContext(Dispatchers.IO) {
URLEncoder.encode(
"${query.songName} ${query.artistName}",
Charsets.UTF_8.toString()
)
}
if (search == "+")
val search = "${query.songName} ${query.artistName}"

if (search == " ")
throw EmptyQueryException()

val response = client.get(
Expand Down

0 comments on commit 7f13824

Please sign in to comment.