Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-06 14:14:19 +08:00
parent 1a8c348af1
commit 07843a5e77
239 changed files with 3175 additions and 13237 deletions

View File

@@ -120,7 +120,7 @@ class _IntroDetailState extends State<PgcIntroPanel>
return ListView(
controller: _controller,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(
padding: .only(
left: 14,
right: 14,
top: 14,

View File

@@ -30,8 +30,6 @@ import 'package:PiliPlus/pages/video/reply/controller.dart';
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
import 'package:PiliPlus/services/service_locator.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/device_utils.dart';
import 'package:PiliPlus/utils/extension/size_ext.dart';
import 'package:PiliPlus/utils/extension/string_ext.dart';
import 'package:PiliPlus/utils/global_data.dart';
import 'package:PiliPlus/utils/id_utils.dart';
@@ -61,29 +59,14 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
// 是否点踩
final RxBool hasDislike = false.obs;
late final showArgueMsg = Pref.showArgueMsg;
late final enableAi = Pref.enableAi;
late final horizontalMemberPage = Pref.horizontalMemberPage;
AiConclusionResult? aiConclusionResult;
late final Map<int?, bool> seasonFavState = {};
@override
void onInit() {
super.onInit();
bool alwaysExpandIntroPanel = Pref.alwaysExpandIntroPanel;
expandableCtr = ExpandableController(
initialExpanded: alwaysExpandIntroPanel,
);
if (!alwaysExpandIntroPanel && Pref.expandIntroPanelH) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!expandableCtr.expanded && !DeviceUtils.size.isPortrait) {
expandableCtr.toggle();
}
});
}
expandableCtr = ExpandableController(initialExpanded: false);
videoDetail.value.title = Get.arguments['title'] ?? '';
}
@@ -530,20 +513,17 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
if (this.bvid != bvid) {
reload = true;
aiConclusionResult = null;
if (cover != null && cover.isNotEmpty) {
videoDetailCtr.cover.value = cover;
}
// 重新请求相关视频
if (videoDetailCtr.plPlayerController.showRelatedVideo) {
try {
Get.find<RelatedController>(tag: heroTag)
..bvid = bvid
..queryData();
} catch (_) {}
}
try {
Get.find<RelatedController>(tag: heroTag)
..bvid = bvid
..queryData();
} catch (_) {}
// 重新请求评论
if (videoDetailCtr.showReply) {
@@ -684,8 +664,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
videoDetailCtr.plPlayerController.play(repeat: true);
return true;
}
if (playRepeat == PlayRepeat.autoPlayRelated &&
videoDetailCtr.plPlayerController.showRelatedVideo) {
if (playRepeat == PlayRepeat.autoPlayRelated) {
return playRelated();
}
return false;
@@ -718,8 +697,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
if (playRepeat == PlayRepeat.listCycle) {
nextIndex = 0;
} else if (playRepeat == PlayRepeat.autoPlayRelated &&
videoDetailCtr.plPlayerController.showRelatedVideo) {
} else if (playRepeat == PlayRepeat.autoPlayRelated) {
return playRelated();
} else {
return false;
@@ -802,12 +780,4 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
}
return null;
}
Future<void> aiConclusion() async {
aiConclusionResult = await getAiConclusion(
bvid,
cid.value,
videoDetail.value.owner?.mid,
);
}
}

View File

@@ -1,4 +1,3 @@
import 'package:PiliPlus/common/assets.dart';
import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/style.dart';
import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
@@ -11,7 +10,6 @@ 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';
@@ -27,12 +25,10 @@ import 'package:PiliPlus/utils/date_utils.dart';
import 'package:PiliPlus/utils/duration_utils.dart';
import 'package:PiliPlus/utils/extension/get_ext.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
import 'package:PiliPlus/utils/extension/num_ext.dart';
import 'package:PiliPlus/utils/extension/string_ext.dart';
import 'package:PiliPlus/utils/extension/theme_ext.dart';
import 'package:PiliPlus/utils/id_utils.dart';
import 'package:PiliPlus/utils/num_utils.dart';
import 'package:PiliPlus/utils/page_utils.dart';
import 'package:PiliPlus/utils/platform_utils.dart';
import 'package:PiliPlus/utils/request_utils.dart';
import 'package:PiliPlus/utils/utils.dart';
@@ -47,14 +43,12 @@ class UgcIntroPanel extends StatefulWidget {
const UgcIntroPanel({
super.key,
required this.heroTag,
required this.showAiBottomSheet,
required this.showEpisodes,
required this.onShowMemberPage,
required this.isPortrait,
required this.isHorizontal,
});
final String heroTag;
final Function showAiBottomSheet;
final Function showEpisodes;
final ValueChanged<int?> onShowMemberPage;
final bool isPortrait;
@@ -195,15 +189,8 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
theme: expandTheme,
),
const SizedBox(height: 8),
Stack(
clipBehavior: Clip.none,
children: [
_buildInfo(theme, videoDetail),
if (introController.enableAi) _aiBtn,
],
),
if (introController.showArgueMsg &&
videoDetail.argueInfo?.argueMsg?.isNotEmpty == true) ...[
_buildInfo(theme, videoDetail),
if (videoDetail.argueInfo?.argueMsg?.isNotEmpty == true) ...[
const SizedBox(height: 2),
Text.rich(
TextSpan(
@@ -690,7 +677,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
}
}
}
PageUtils.handleWebview(matchStr);
PiliScheme.routePushFromUrl(matchStr);
},
),
);
@@ -989,37 +976,6 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
],
);
Widget get _aiBtn => Positioned(
right: 8,
child: Center(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if (introController.aiConclusionResult == null) {
await introController.aiConclusion();
}
if (introController.aiConclusionResult case AiConclusionResult(
:final summary,
:final outline,
)) {
if (summary?.isNotEmpty == true || outline?.isNotEmpty == true) {
widget.showAiBottomSheet();
} else {
SmartDialog.showToast("当前视频不支持AI视频总结");
}
}
},
child: Image.asset(
semanticLabel: 'AI总结',
Assets.ai,
height: 18,
width: 18,
cacheHeight: 18.cacheSize(context),
),
),
),
);
Widget _buildTags(List<VideoTagItem> tags) {
return GestureDetector(
onTap: () {},