🐛 Bug fixes of querying backend

This commit is contained in:
2024-09-06 18:10:12 +08:00
parent 499bca5b1c
commit 222d50d80d
7 changed files with 124 additions and 105 deletions

View File

@ -5,8 +5,10 @@ import 'package:rhythm_box/platform.dart';
class AutoCacheImage extends StatelessWidget {
final String url;
final double? width, height;
final BoxFit? fit;
const AutoCacheImage(this.url, {super.key, this.width, this.height});
const AutoCacheImage(this.url,
{super.key, this.width, this.height, this.fit});
@override
Widget build(BuildContext context) {
@ -15,12 +17,14 @@ class AutoCacheImage extends StatelessWidget {
imageUrl: url,
width: width,
height: height,
fit: fit,
);
}
return Image.network(
url,
width: width,
height: height,
fit: fit,
);
}

View File

@ -116,11 +116,10 @@ class _SiblingTracksState extends State<SiblingTracks> {
);
} else if (preferences.audioSource == AudioSource.netease) {
final client = NeteaseSourcedTrack.getClient();
final resp = await client
.get('/search?keywords=${Uri.encodeComponent(searchTerm)}');
final resp = await client.get(
'/search?keywords=${Uri.encodeComponent(searchTerm)}&realIP=${NeteaseSourcedTrack.lookupRealIp()}');
final searchResults = resp.body['result']['songs']
.map(NeteaseSourcedTrack.toSiblingType)
.map((x) => x.info)
.map(NeteaseSourcedTrack.toSourceInfo)
.toList();
final activeSourceInfo = (_activeTrack! as SourcedTrack).sourceInfo;