check live playurl

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-04 21:02:02 +08:00
parent 9057401b16
commit a441759eb6
2 changed files with 15 additions and 9 deletions

View File

@@ -76,7 +76,11 @@ abstract final class LiveHttp {
}
}
static Future liveRoomInfo({roomId, qn, bool onlyAudio = false}) async {
static Future<LoadingState<RoomPlayInfoData>> liveRoomInfo({
roomId,
qn,
bool onlyAudio = false,
}) async {
var res = await Request().get(
Api.liveRoomInfo,
queryParameters: {
@@ -93,12 +97,9 @@ abstract final class LiveHttp {
},
);
if (res.data['code'] == 0) {
return {
'status': true,
'data': RoomPlayInfoData.fromJson(res.data['data']),
};
return Success(RoomPlayInfoData.fromJson(res.data['data']));
} else {
return {'status': false, 'msg': res.data['message']};
return Error(res.data['message']);
}
}