Skip to content

Commit

Permalink
Merge pull request #75 from Risuntsy/master
Browse files Browse the repository at this point in the history
 fix: remove unnecessary manual encoding of parameter
  • Loading branch information
Lambada10 committed Aug 12, 2024
2 parents ddf4f8d + cac6e61 commit 4ce11c5
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 4ce11c5

Please sign in to comment.