mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-13 12:50:10 +08:00
fix: null aid
This commit is contained in:
committed by
bggRGjQaUbCoE
parent
cf4ad87b20
commit
5a6c73b8cf
@@ -257,7 +257,7 @@ class _EpisodePanelState extends CommonCollapseSlidePageState<EpisodePanel> {
|
|||||||
return _buildBody(theme, 0, _getCurrEpisodes);
|
return _buildBody(theme, 0, _getCurrEpisodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBody(ThemeData theme, int tabIndex, episodes) {
|
Widget _buildBody(ThemeData theme, int tabIndex, List episodes) {
|
||||||
final isCurrTab = tabIndex == widget.initialTabIndex;
|
final isCurrTab = tabIndex == widget.initialTabIndex;
|
||||||
return KeepAliveWrapper(
|
return KeepAliveWrapper(
|
||||||
builder: (context) => ScrollablePositionedList.separated(
|
builder: (context) => ScrollablePositionedList.separated(
|
||||||
@@ -269,7 +269,7 @@ class _EpisodePanelState extends CommonCollapseSlidePageState<EpisodePanel> {
|
|||||||
itemCount: episodes.length,
|
itemCount: episodes.length,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
itemBuilder: (BuildContext context, int itemIndex) {
|
itemBuilder: (BuildContext context, int itemIndex) {
|
||||||
final episode = episodes[itemIndex];
|
final ugc.BaseEpisodeItem episode = episodes[itemIndex];
|
||||||
final isCurrItem = isCurrTab ? itemIndex == _currentItemIndex : false;
|
final isCurrItem = isCurrTab ? itemIndex == _currentItemIndex : false;
|
||||||
Widget episodeItem = _buildEpisodeItem(
|
Widget episodeItem = _buildEpisodeItem(
|
||||||
theme: theme,
|
theme: theme,
|
||||||
@@ -278,9 +278,9 @@ class _EpisodePanelState extends CommonCollapseSlidePageState<EpisodePanel> {
|
|||||||
length: episodes.length,
|
length: episodes.length,
|
||||||
isCurrentIndex: isCurrItem,
|
isCurrentIndex: isCurrItem,
|
||||||
);
|
);
|
||||||
if (widget.type == EpisodeType.season &&
|
if (episode is ugc.EpisodeItem &&
|
||||||
widget.showTitle &&
|
widget.showTitle &&
|
||||||
episode.pages.length > 1) {
|
episode.pages!.length > 1) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -296,7 +296,7 @@ class _EpisodePanelState extends CommonCollapseSlidePageState<EpisodePanel> {
|
|||||||
cover: episode.arc?.pic,
|
cover: episode.arc?.pic,
|
||||||
heroTag: widget.heroTag,
|
heroTag: widget.heroTag,
|
||||||
ugcIntroController: widget.ugcIntroController!,
|
ugcIntroController: widget.ugcIntroController!,
|
||||||
bvid: IdUtils.av2bv(episode.aid),
|
bvid: episode.bvid ?? IdUtils.av2bv(episode.aid!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import 'package:PiliPlus/main.dart';
|
|||||||
import 'package:PiliPlus/models/common/episode_panel_type.dart';
|
import 'package:PiliPlus/models/common/episode_panel_type.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/video/video_detail/page.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||||
|
import 'package:PiliPlus/models_new/video/video_detail/ugc_season.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_tag/data.dart';
|
import 'package:PiliPlus/models_new/video/video_tag/data.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
|
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
|
||||||
import 'package:PiliPlus/pages/danmaku/view.dart';
|
import 'package:PiliPlus/pages/danmaku/view.dart';
|
||||||
@@ -1954,11 +1955,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
: pgcIntroController.onChangeEpisode,
|
: pgcIntroController.onChangeEpisode,
|
||||||
showTitle: false,
|
showTitle: false,
|
||||||
isSupportReverse: videoDetailController.isUgc,
|
isSupportReverse: videoDetailController.isUgc,
|
||||||
onReverse: () => onReversePlay(
|
onReverse: () => onReversePlay(isSeason: false),
|
||||||
bvid: videoDetailController.bvid,
|
|
||||||
aid: videoDetailController.aid,
|
|
||||||
isSeason: false,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -2009,11 +2006,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
: pgcIntroController.onChangeEpisode,
|
: pgcIntroController.onChangeEpisode,
|
||||||
showTitle: false,
|
showTitle: false,
|
||||||
isSupportReverse: videoDetailController.isUgc,
|
isSupportReverse: videoDetailController.isUgc,
|
||||||
onReverse: () => onReversePlay(
|
onReverse: () => onReversePlay(isSeason: true),
|
||||||
bvid: videoDetailController.bvid,
|
|
||||||
aid: videoDetailController.aid,
|
|
||||||
isSeason: true,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -2078,7 +2071,15 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showEpisodes([int? index, season, episodes, bvid, aid, cid]) {
|
void showEpisodes([
|
||||||
|
int? index,
|
||||||
|
UgcSeason? season,
|
||||||
|
episodes,
|
||||||
|
String? bvid,
|
||||||
|
int? aid,
|
||||||
|
int? cid,
|
||||||
|
]) {
|
||||||
|
assert((cid == null) == (bvid == null));
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
if (cid == null) {
|
if (cid == null) {
|
||||||
videoDetailController.showMediaListPanel(context);
|
videoDetailController.showMediaListPanel(context);
|
||||||
@@ -2097,11 +2098,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
cover: videoDetailController.cover.value,
|
cover: videoDetailController.cover.value,
|
||||||
enableSlide: enableSlide,
|
enableSlide: enableSlide,
|
||||||
initialTabIndex: index ?? 0,
|
initialTabIndex: index ?? 0,
|
||||||
bvid: bvid,
|
bvid: bvid!,
|
||||||
aid: aid,
|
aid: aid,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
seasonId: season?.id,
|
seasonId: season?.id,
|
||||||
list: season != null ? season.sections : [episodes],
|
list: season != null ? season.sections! : [episodes],
|
||||||
isReversed: !videoDetailController.isUgc
|
isReversed: !videoDetailController.isUgc
|
||||||
? null
|
? null
|
||||||
: season != null
|
: season != null
|
||||||
@@ -2119,11 +2120,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
onClose: Get.back,
|
onClose: Get.back,
|
||||||
onReverse: () {
|
onReverse: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
onReversePlay(
|
onReversePlay(isSeason: season != null);
|
||||||
bvid: bvid,
|
|
||||||
aid: aid,
|
|
||||||
isSeason: season != null,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (isFullScreen || videoDetailController.showVideoSheet) {
|
if (isFullScreen || videoDetailController.showVideoSheet) {
|
||||||
@@ -2146,11 +2143,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onReversePlay({
|
void onReversePlay({required bool isSeason}) {
|
||||||
required dynamic bvid,
|
|
||||||
required dynamic aid,
|
|
||||||
required bool isSeason,
|
|
||||||
}) {
|
|
||||||
if (isSeason && videoDetailController.isPlayAll) {
|
if (isSeason && videoDetailController.isPlayAll) {
|
||||||
SmartDialog.showToast('当前为播放全部,合集不支持倒序');
|
SmartDialog.showToast('当前为播放全部,合集不支持倒序');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:PiliPlus/models/common/video/video_quality.dart';
|
|||||||
import 'package:PiliPlus/models/video/play/url.dart';
|
import 'package:PiliPlus/models/video/play/url.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_detail/section.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/section.dart';
|
||||||
|
import 'package:PiliPlus/models_new/video/video_detail/ugc_season.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_shot/data.dart';
|
import 'package:PiliPlus/models_new/video/video_shot/data.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
|
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
|
||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
@@ -83,7 +84,8 @@ class PLVideoPlayer extends StatefulWidget {
|
|||||||
|
|
||||||
final Widget? customWidget;
|
final Widget? customWidget;
|
||||||
final List<Widget>? customWidgets;
|
final List<Widget>? customWidgets;
|
||||||
final Function? showEpisodes;
|
final void Function([int?, UgcSeason?, dynamic, String?, int?, int?])?
|
||||||
|
showEpisodes;
|
||||||
final VoidCallback? showViewPoints;
|
final VoidCallback? showViewPoints;
|
||||||
final Color? fill;
|
final Color? fill;
|
||||||
final Alignment? alignment;
|
final Alignment? alignment;
|
||||||
|
|||||||
Reference in New Issue
Block a user