mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-05 17:47:46 +08:00
@@ -3,6 +3,7 @@ import 'dart:io' show File;
|
||||
|
||||
import 'package:PiliPlus/grpc/bilibili/community/service/dm/v1.pb.dart';
|
||||
import 'package:PiliPlus/grpc/dm.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/path_utils.dart';
|
||||
@@ -46,17 +47,16 @@ class PlDanmakuController {
|
||||
return;
|
||||
}
|
||||
_requestedSeg.add(segmentIndex);
|
||||
final result = await DmGrpc.dmSegMobile(
|
||||
final res = await DmGrpc.dmSegMobile(
|
||||
cid: _cid,
|
||||
segmentIndex: segmentIndex + 1,
|
||||
);
|
||||
|
||||
if (result.isSuccess) {
|
||||
final data = result.data;
|
||||
if (data.state == 1) {
|
||||
if (res case Success(:final response)) {
|
||||
if (response.state == 1) {
|
||||
_plPlayerController.dmState.add(_cid);
|
||||
}
|
||||
handleDanmaku(data.elems);
|
||||
handleDanmaku(response.elems);
|
||||
} else {
|
||||
_requestedSeg.remove(segmentIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user