mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
@@ -29,7 +29,6 @@ import 'package:PiliPlus/utils/date_util.dart';
|
|||||||
import 'package:PiliPlus/utils/duration_util.dart';
|
import 'package:PiliPlus/utils/duration_util.dart';
|
||||||
import 'package:PiliPlus/utils/id_utils.dart';
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||||
import 'package:flutter/material.dart' hide TabBarView;
|
import 'package:flutter/material.dart' hide TabBarView;
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
@@ -366,14 +365,7 @@ class _EpisodePanelState extends CommonSlidePageState<EpisodePanel> {
|
|||||||
break;
|
break;
|
||||||
case pgc.EpisodeItem item:
|
case pgc.EpisodeItem item:
|
||||||
bvid = item.bvid;
|
bvid = item.bvid;
|
||||||
if (item.longTitle != null && item.longTitle != "") {
|
title = item.showTitle ?? item.title!;
|
||||||
dynamic leading = item.title ?? index + 1;
|
|
||||||
title =
|
|
||||||
"${Utils.isStringNumeric(leading) ? '第$leading话' : leading} ${episode.longTitle!}";
|
|
||||||
} else {
|
|
||||||
title = item.title!;
|
|
||||||
}
|
|
||||||
|
|
||||||
cover = item.cover;
|
cover = item.cover;
|
||||||
duration = item.duration == null ? null : item.duration! ~/ 1000;
|
duration = item.duration == null ? null : item.duration! ~/ 1000;
|
||||||
pubdate = item.pubTime;
|
pubdate = item.pubTime;
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||||
show ReplyInfo;
|
show ReplyInfo;
|
||||||
|
import 'package:PiliPlus/models/common/search_type.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
|
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/widgets/dynamic_panel.dart';
|
import 'package:PiliPlus/pages/dynamics/widgets/dynamic_panel.dart';
|
||||||
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
|
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
|
||||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||||
@@ -88,8 +90,13 @@ class _SavePanelState extends State<SavePanel> {
|
|||||||
|
|
||||||
if (currentRoute.startsWith('/video')) {
|
if (currentRoute.startsWith('/video')) {
|
||||||
try {
|
try {
|
||||||
final heroTag = Get.arguments?['heroTag'];
|
final heroTag = Get.arguments['heroTag'];
|
||||||
late final ctr = Get.find<UgcIntroController>(tag: heroTag);
|
CommonIntroController ctr;
|
||||||
|
if (Get.arguments['videoType'] == SearchType.media_bangumi) {
|
||||||
|
ctr = Get.find<PgcIntroController>(tag: heroTag);
|
||||||
|
} else {
|
||||||
|
ctr = Get.find<UgcIntroController>(tag: heroTag);
|
||||||
|
}
|
||||||
final videoDetail = ctr.videoDetail.value;
|
final videoDetail = ctr.videoDetail.value;
|
||||||
cover = videoDetail.pic;
|
cover = videoDetail.pic;
|
||||||
title = videoDetail.title;
|
title = videoDetail.title;
|
||||||
@@ -100,7 +107,7 @@ class _SavePanelState extends State<SavePanel> {
|
|||||||
'bilibili://video/${reply.oid}?comment_root_id=${hasRoot ? reply.root : reply.id}${hasRoot ? '&comment_secondary_id=${reply.id}' : ''}';
|
'bilibili://video/${reply.oid}?comment_root_id=${hasRoot ? reply.root : reply.id}${hasRoot ? '&comment_secondary_id=${reply.id}' : ''}';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final heroTag = Get.arguments?['heroTag'];
|
final heroTag = Get.arguments['heroTag'];
|
||||||
late final ctr = Get.find<PgcIntroController>(tag: heroTag);
|
late final ctr = Get.find<PgcIntroController>(tag: heroTag);
|
||||||
final type = reply.type.toInt();
|
final type = reply.type.toInt();
|
||||||
late final oid = reply.oid;
|
late final oid = reply.oid;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import 'package:PiliPlus/models/pgc_lcf.dart';
|
|||||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
||||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
||||||
import 'package:PiliPlus/models_new/triple/pgc_triple.dart';
|
import 'package:PiliPlus/models_new/triple/pgc_triple.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_detail/data.dart';
|
|
||||||
import 'package:PiliPlus/models_new/video/video_detail/stat_detail.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/stat_detail.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
|
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
||||||
@@ -289,6 +288,7 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
queryPgcLikeCoinFav();
|
queryPgcLikeCoinFav();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasLater.value = false;
|
||||||
this.cid.value = cid;
|
this.cid.value = cid;
|
||||||
queryVideoIntro();
|
queryVideoIntro();
|
||||||
queryOnlineTotal();
|
queryOnlineTotal();
|
||||||
@@ -457,11 +457,15 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> queryVideoIntro() async {
|
Future<void> queryVideoIntro() async {
|
||||||
var res = await VideoHttp.videoIntro(bvid: bvid);
|
final episode = pgcItem.episodes!.firstWhere((e) => e.cid == cid.value);
|
||||||
if (res.isSuccess) {
|
videoPlayerServiceHandler.onVideoDetailChange(
|
||||||
VideoDetailData data = res.data;
|
episode,
|
||||||
videoPlayerServiceHandler.onVideoDetailChange(data, data.cid!, heroTag);
|
cid.value,
|
||||||
videoDetail.value = data;
|
heroTag,
|
||||||
}
|
artist: pgcItem.title,
|
||||||
|
);
|
||||||
|
videoDetail
|
||||||
|
..value.title = episode.showTitle
|
||||||
|
..refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,26 +145,30 @@ class _IntroDetailState extends CommonCollapseSlidePageState<PgcIntroPanel> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
if (widget.item.evaluate?.isNotEmpty == true) ...[
|
||||||
Text(
|
const SizedBox(height: 20),
|
||||||
'简介:',
|
Text(
|
||||||
style: theme.textTheme.titleMedium,
|
'简介:',
|
||||||
),
|
style: theme.textTheme.titleMedium,
|
||||||
const SizedBox(height: 4),
|
),
|
||||||
Text(
|
const SizedBox(height: 4),
|
||||||
widget.item.evaluate!,
|
Text(
|
||||||
style: textStyle,
|
widget.item.evaluate!,
|
||||||
),
|
style: textStyle,
|
||||||
const SizedBox(height: 20),
|
),
|
||||||
Text(
|
],
|
||||||
'演职人员:',
|
if (widget.item.actors?.isNotEmpty == true) ...[
|
||||||
style: theme.textTheme.titleMedium,
|
const SizedBox(height: 20),
|
||||||
),
|
Text(
|
||||||
const SizedBox(height: 4),
|
'演职人员:',
|
||||||
Text(
|
style: theme.textTheme.titleMedium,
|
||||||
widget.item.actors!,
|
),
|
||||||
style: textStyle,
|
const SizedBox(height: 4),
|
||||||
),
|
Text(
|
||||||
|
widget.item.actors!,
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
if (widget.videoTags?.isNotEmpty == true) ...[
|
if (widget.videoTags?.isNotEmpty == true) ...[
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Wrap(
|
Wrap(
|
||||||
|
|||||||
@@ -468,7 +468,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
int currentCid = plPlayerController.cid;
|
int currentCid = plPlayerController.cid;
|
||||||
String bvid = plPlayerController.bvid;
|
String bvid = plPlayerController.bvid;
|
||||||
List episodes = [];
|
List episodes = [];
|
||||||
final videoDetail = introController.videoDetail.value;
|
|
||||||
if (isSeason) {
|
if (isSeason) {
|
||||||
final List<SectionItem> sections =
|
final List<SectionItem> sections =
|
||||||
videoDetail.ugcSeason!.sections!;
|
videoDetail.ugcSeason!.sections!;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:PiliPlus/models_new/live/live_room_info_h5/data.dart';
|
import 'package:PiliPlus/models_new/live/live_room_info_h5/data.dart';
|
||||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_detail/data.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/data.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
||||||
@@ -113,7 +113,12 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
|||||||
setPlaybackState(status, isBuffering, isLive);
|
setPlaybackState(status, isBuffering, isLive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onVideoDetailChange(dynamic data, int cid, String herotag) {
|
void onVideoDetailChange(
|
||||||
|
dynamic data,
|
||||||
|
int cid,
|
||||||
|
String herotag, {
|
||||||
|
String? artist,
|
||||||
|
}) {
|
||||||
if (!enableBackgroundPlay) return;
|
if (!enableBackgroundPlay) return;
|
||||||
// if (kDebugMode) {
|
// if (kDebugMode) {
|
||||||
// debugPrint('当前调用栈为:');
|
// debugPrint('当前调用栈为:');
|
||||||
@@ -131,37 +136,33 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
|||||||
);
|
);
|
||||||
mediaItem = MediaItem(
|
mediaItem = MediaItem(
|
||||||
id: id,
|
id: id,
|
||||||
title: current?.pagePart ?? "",
|
title: current?.pagePart ?? '',
|
||||||
artist: data.title ?? "",
|
artist: data.owner?.name,
|
||||||
album: data.title ?? "",
|
|
||||||
duration: Duration(seconds: current?.duration ?? 0),
|
duration: Duration(seconds: current?.duration ?? 0),
|
||||||
artUri: Uri.parse(data.pic ?? ""),
|
artUri: Uri.parse(data.pic ?? ''),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
mediaItem = MediaItem(
|
mediaItem = MediaItem(
|
||||||
id: id,
|
id: id,
|
||||||
title: data.title ?? "",
|
title: data.title ?? '',
|
||||||
artist: data.owner?.name ?? "",
|
artist: data.owner?.name,
|
||||||
duration: Duration(seconds: data.duration ?? 0),
|
duration: Duration(seconds: data.duration ?? 0),
|
||||||
artUri: Uri.parse(data.pic ?? ""),
|
artUri: Uri.parse(data.pic ?? ''),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (data is PgcInfoModel) {
|
} else if (data is EpisodeItem) {
|
||||||
final current = data.episodes?.firstWhereOrNull(
|
|
||||||
(element) => element.cid == cid,
|
|
||||||
);
|
|
||||||
mediaItem = MediaItem(
|
mediaItem = MediaItem(
|
||||||
id: id,
|
id: id,
|
||||||
title: current?.longTitle ?? "",
|
title: data.showTitle ?? data.title ?? '',
|
||||||
artist: data.title ?? "",
|
artist: artist,
|
||||||
duration: Duration(milliseconds: current?.duration ?? 0),
|
duration: Duration(milliseconds: data.duration ?? 0),
|
||||||
artUri: Uri.parse(data.cover ?? ""),
|
artUri: Uri.parse(data.cover ?? ''),
|
||||||
);
|
);
|
||||||
} else if (data is RoomInfoH5Data) {
|
} else if (data is RoomInfoH5Data) {
|
||||||
mediaItem = MediaItem(
|
mediaItem = MediaItem(
|
||||||
id: id,
|
id: id,
|
||||||
title: data.roomInfo?.title ?? '',
|
title: data.roomInfo?.title ?? '',
|
||||||
artist: data.anchorInfo?.baseInfo?.uname ?? '',
|
artist: data.anchorInfo?.baseInfo?.uname,
|
||||||
artUri: Uri.parse(data.roomInfo?.cover ?? ''),
|
artUri: Uri.parse(data.roomInfo?.cover ?? ''),
|
||||||
isLive: true,
|
isLive: true,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user