Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-27 20:54:41 +08:00
parent 25acf3a9bb
commit b51c646415
227 changed files with 768 additions and 764 deletions

View File

@@ -76,7 +76,7 @@ class PgcIntroController extends CommonIntroController {
// 获取点赞/投币/收藏状态
Future<void> queryPgcLikeCoinFav() async {
var result = await VideoHttp.pgcLikeCoinFav(epId: epId!);
final result = await VideoHttp.pgcLikeCoinFav(epId: epId!);
if (result case Success(:final response)) {
final hasLike = response.like == 1;
final hasFav = response.favorite == 1;
@@ -103,7 +103,7 @@ class PgcIntroController extends CommonIntroController {
return;
}
final newVal = !hasLike.value;
var result = await VideoHttp.likeVideo(bvid: bvid, type: newVal);
final result = await VideoHttp.likeVideo(bvid: bvid, type: newVal);
if (result case Success(:final response)) {
SmartDialog.showToast(newVal ? response : '取消赞');
pgcItem.stat?.like += newVal ? 1 : -1;
@@ -332,7 +332,7 @@ class PgcIntroController extends CommonIntroController {
// 追番
Future<void> pgcAdd() async {
var result = await VideoHttp.pgcAdd(seasonId: pgcItem.seasonId);
final result = await VideoHttp.pgcAdd(seasonId: pgcItem.seasonId);
if (result case Success(:final response)) {
isFollowed.value = true;
followStatus.value = 2;
@@ -344,7 +344,7 @@ class PgcIntroController extends CommonIntroController {
// 取消追番
Future<void> pgcDel() async {
var result = await VideoHttp.pgcDel(seasonId: pgcItem.seasonId);
final result = await VideoHttp.pgcDel(seasonId: pgcItem.seasonId);
if (result case Success(:final response)) {
isFollowed.value = false;
SmartDialog.showToast(response);
@@ -354,7 +354,7 @@ class PgcIntroController extends CommonIntroController {
}
Future<void> pgcUpdate(int status) async {
var result = await VideoHttp.pgcUpdate(
final result = await VideoHttp.pgcUpdate(
seasonId: pgcItem.seasonId.toString(),
status: status,
);
@@ -427,7 +427,7 @@ class PgcIntroController extends CommonIntroController {
SmartDialog.showToast('已三连');
return;
}
var result = await VideoHttp.pgcTriple(epId: epId!, seasonId: seasonId);
final result = await VideoHttp.pgcTriple(epId: epId!, seasonId: seasonId);
if (result case Success(:final response)) {
late final stat = pgcItem.stat;
if (response.like == 1 && !hasLike.value) {
@@ -455,7 +455,7 @@ class PgcIntroController extends CommonIntroController {
Future<void> queryIsFollowed() async {
// try {
// var result = await Request().get(
// final result = await Request().get(
// 'https://www.bilibili.com/bangumi/play/ss$seasonId',
// );
// dom.Document document = html_parser.parse(result.data);
@@ -473,7 +473,7 @@ class PgcIntroController extends CommonIntroController {
// ViewGrpc.view(bvid: bvid).then((res) {
// if (res.isSuccess) {
// ViewPgcAny view = ViewPgcAny.fromBuffer(res.data.supplement.value);
// var userStatus = view.ogvData.userStatus;
// final userStatus = view.ogvData.userStatus;
// isFollowed.value = userStatus.follow == 1;
// followStatus.value = userStatus.followStatus;
// }

View File

@@ -89,7 +89,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
@override
Future<void> queryVideoIntro() async {
queryVideoTags();
var res = await VideoHttp.videoIntro(bvid: bvid);
final res = await VideoHttp.videoIntro(bvid: bvid);
if (res.isSuccess) {
VideoDetailData data = res.data;
videoPlayerServiceHandler?.onVideoDetailChange(data, cid.value, heroTag);
@@ -154,7 +154,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
if (mid == null) {
return;
}
var result = await MemberHttp.memberCardInfo(mid: mid);
final result = await MemberHttp.memberCardInfo(mid: mid);
if (result.isSuccess) {
userStat.value = result.data;
}
@@ -162,8 +162,8 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
}
Future<void> queryAllStatus() async {
var result = await VideoHttp.videoRelation(bvid: bvid);
if (result case Success(:var response)) {
final result = await VideoHttp.videoRelation(bvid: bvid);
if (result case Success(:final response)) {
late final stat = videoDetail.value.stat;
if (response.like!) {
stat?.like = max(1, stat.like);
@@ -191,7 +191,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
SmartDialog.showToast('已三连');
return;
}
var result = await VideoHttp.ugcTriple(bvid: bvid);
final result = await VideoHttp.ugcTriple(bvid: bvid);
if (result case Success(:final response)) {
late final stat = videoDetail.value.stat;
if (response.like == true && !hasLike.value) {
@@ -229,7 +229,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
return;
}
final newVal = !hasLike.value;
var result = await VideoHttp.likeVideo(bvid: bvid, type: newVal);
final result = await VideoHttp.likeVideo(bvid: bvid, type: newVal);
if (result case Success(:final response)) {
SmartDialog.showToast(newVal ? response : '取消赞');
videoDetail.value.stat?.like += newVal ? 1 : -1;
@@ -247,7 +247,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
SmartDialog.showToast('账号未登录');
return;
}
var result = await VideoHttp.dislikeVideo(
final result = await VideoHttp.dislikeVideo(
bvid: bvid,
type: !hasDislike.value,
);
@@ -413,7 +413,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
if (videoDetail.owner == null || videoDetail.staff?.isNotEmpty == true) {
return;
}
var result = await UserHttp.hasFollow(videoDetail.owner!.mid!);
final result = await UserHttp.hasFollow(videoDetail.owner!.mid!);
if (result['status']) {
Map data = result['data'];
if (data['special'] == 1) data['attribute'] = -10;
@@ -437,7 +437,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
}
int attr = followStatus['attribute'] ?? 0;
if (attr == 128) {
var res = await VideoHttp.relationMod(
final res = await VideoHttp.relationMod(
mid: mid,
act: 6,
reSrc: 11,

View File

@@ -7,6 +7,7 @@ import 'package:PiliPlus/common/widgets/stat/stat.dart';
import 'package:PiliPlus/http/sponsor_block.dart';
import 'package:PiliPlus/models/common/image_type.dart';
import 'package:PiliPlus/models/common/stat_type.dart';
import 'package:PiliPlus/models_new/video/video_ai_conclusion/model_result.dart';
import 'package:PiliPlus/models_new/video/video_detail/data.dart';
import 'package:PiliPlus/models_new/video/video_detail/staff.dart';
import 'package:PiliPlus/models_new/video/video_tag/data.dart';
@@ -985,9 +986,11 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
if (introController.aiConclusionResult == null) {
await introController.aiConclusion();
}
if (introController.aiConclusionResult case final res?) {
if (res.summary?.isNotEmpty == true ||
res.outline?.isNotEmpty == true) {
if (introController.aiConclusionResult case AiConclusionResult(
:final summary,
:final outline,
)) {
if (summary?.isNotEmpty == true || outline?.isNotEmpty == true) {
widget.showAiBottomSheet();
} else {
SmartDialog.showToast("当前视频不支持AI视频总结");