From a6b40e81a7a90017771175be3aa83271aafb1352 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 11 Sep 2024 20:37:42 +0800 Subject: [PATCH] :bug: Bug fixes on looking up ips --- lib/services/sourced_track/sources/netease.dart | 2 +- lib/widgets/player/sibling_tracks.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/sourced_track/sources/netease.dart b/lib/services/sourced_track/sources/netease.dart index 9a50e68..6beb5e7 100755 --- a/lib/services/sourced_track/sources/netease.dart +++ b/lib/services/sourced_track/sources/netease.dart @@ -175,7 +175,7 @@ class NeteaseSourcedTrack extends SourcedTrack { final client = getClient(); final resp = await client.get( - '/search?keywords=${Uri.encodeComponent(query)}&realIP=${NeteaseSourcedTrack.lookupRealIp()}', + '/search?keywords=${Uri.encodeComponent(query)}&realIP=${await NeteaseSourcedTrack.lookupRealIp()}', ); if (resp.body?['code'] == 405) throw TrackNotFoundError(track); final results = resp.body['result']['songs']; diff --git a/lib/widgets/player/sibling_tracks.dart b/lib/widgets/player/sibling_tracks.dart index 0072bbd..0936bb3 100644 --- a/lib/widgets/player/sibling_tracks.dart +++ b/lib/widgets/player/sibling_tracks.dart @@ -120,7 +120,7 @@ class _SiblingTracksState extends State { } else if (preferences.audioSource == AudioSource.netease) { final client = NeteaseSourcedTrack.getClient(); final resp = await client.get( - '/search?keywords=${Uri.encodeComponent(searchTerm)}&realIP=${NeteaseSourcedTrack.lookupRealIp()}'); + '/search?keywords=${Uri.encodeComponent(searchTerm)}&realIP=${await NeteaseSourcedTrack.lookupRealIp()}'); final searchResults = resp.body['result']['songs'] .map(NeteaseSourcedTrack.toSourceInfo) .toList();