🐛 Bug fixes on looking up ips

This commit is contained in:
LittleSheep 2024-09-11 20:37:42 +08:00
parent 1913a7e909
commit a6b40e81a7
2 changed files with 2 additions and 2 deletions

View File

@ -175,7 +175,7 @@ class NeteaseSourcedTrack extends SourcedTrack {
final client = getClient(); final client = getClient();
final resp = await client.get( 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); if (resp.body?['code'] == 405) throw TrackNotFoundError(track);
final results = resp.body['result']['songs']; final results = resp.body['result']['songs'];

View File

@ -120,7 +120,7 @@ class _SiblingTracksState extends State<SiblingTracks> {
} else if (preferences.audioSource == AudioSource.netease) { } else if (preferences.audioSource == AudioSource.netease) {
final client = NeteaseSourcedTrack.getClient(); final client = NeteaseSourcedTrack.getClient();
final resp = await client.get( 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'] final searchResults = resp.body['result']['songs']
.map(NeteaseSourcedTrack.toSourceInfo) .map(NeteaseSourcedTrack.toSourceInfo)
.toList(); .toList();