mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: requery dm
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -9,12 +9,23 @@ class DanmakuHttp {
|
|||||||
required int cid,
|
required int cid,
|
||||||
required int segmentIndex,
|
required int segmentIndex,
|
||||||
required bool mergeDanmaku,
|
required bool mergeDanmaku,
|
||||||
|
int queryCount = 1,
|
||||||
}) async {
|
}) async {
|
||||||
// 构建参数对象
|
// 构建参数对象
|
||||||
final response =
|
final response =
|
||||||
await GrpcRepo.dmSegMobile(cid: cid, segmentIndex: segmentIndex);
|
await GrpcRepo.dmSegMobile(cid: cid, segmentIndex: segmentIndex);
|
||||||
if (!response['status']) {
|
if (!response['status']) {
|
||||||
return DmSegMobileReply();
|
if (queryCount >= 3) {
|
||||||
|
return DmSegMobileReply();
|
||||||
|
} else {
|
||||||
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
|
return await queryDanmaku(
|
||||||
|
cid: cid,
|
||||||
|
segmentIndex: segmentIndex,
|
||||||
|
mergeDanmaku: mergeDanmaku,
|
||||||
|
queryCount: ++queryCount,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DmSegMobileReply data = response['data'];
|
DmSegMobileReply data = response['data'];
|
||||||
if (mergeDanmaku && data.elems.isNotEmpty) {
|
if (mergeDanmaku && data.elems.isNotEmpty) {
|
||||||
|
|||||||
Reference in New Issue
Block a user