mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-16 23:26:14 +08:00
opt change episode
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -67,7 +67,7 @@ class _SelfSizedHorizontalListState extends State<SelfSizedHorizontalList> {
|
|||||||
padding: widget.padding,
|
padding: widget.padding,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: widget.itemCount,
|
itemCount: widget.itemCount,
|
||||||
itemBuilder: (c, i) => widget.childBuilder.call(i),
|
itemBuilder: (c, i) => widget.childBuilder(i),
|
||||||
separatorBuilder: (c, i) => SizedBox(width: widget.gapSize),
|
separatorBuilder: (c, i) => SizedBox(width: widget.gapSize),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,22 +1,24 @@
|
|||||||
import 'package:PiliPlus/models_new/media_list/media_list.dart';
|
import 'package:PiliPlus/models_new/media_list/media_list.dart';
|
||||||
|
|
||||||
class MediaListData {
|
class MediaListData {
|
||||||
List<MediaListItemModel>? mediaList;
|
List<MediaListItemModel> mediaList;
|
||||||
bool? hasMore;
|
bool? hasMore;
|
||||||
int? totalCount;
|
int? totalCount;
|
||||||
String? nextStartKey;
|
String? nextStartKey;
|
||||||
|
|
||||||
MediaListData({
|
MediaListData({
|
||||||
this.mediaList,
|
required this.mediaList,
|
||||||
this.hasMore,
|
this.hasMore,
|
||||||
this.totalCount,
|
this.totalCount,
|
||||||
this.nextStartKey,
|
this.nextStartKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory MediaListData.fromJson(Map<String, dynamic> json) => MediaListData(
|
factory MediaListData.fromJson(Map<String, dynamic> json) => MediaListData(
|
||||||
mediaList: (json['media_list'] as List<dynamic>?)
|
mediaList:
|
||||||
|
(json['media_list'] as List<dynamic>?)
|
||||||
?.map((e) => MediaListItemModel.fromJson(e as Map<String, dynamic>))
|
?.map((e) => MediaListItemModel.fromJson(e as Map<String, dynamic>))
|
||||||
.toList(),
|
.toList() ??
|
||||||
|
<MediaListItemModel>[],
|
||||||
hasMore: json['has_more'] as bool?,
|
hasMore: json['has_more'] as bool?,
|
||||||
totalCount: json['total_count'] as int?,
|
totalCount: json['total_count'] as int?,
|
||||||
nextStartKey: json['next_start_key'] as String?,
|
nextStartKey: json['next_start_key'] as String?,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import 'package:PiliPlus/models/model_owner.dart';
|
import 'package:PiliPlus/models/model_owner.dart';
|
||||||
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/badge.dart';
|
|
||||||
import 'package:PiliPlus/models_new/media_list/coin.dart';
|
import 'package:PiliPlus/models_new/media_list/coin.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/ogv_info.dart';
|
import 'package:PiliPlus/models_new/media_list/ogv_info.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/page.dart';
|
import 'package:PiliPlus/models_new/media_list/page.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/rights.dart';
|
import 'package:PiliPlus/models_new/media_list/rights.dart';
|
||||||
|
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
|
|
||||||
class MediaListItemModel {
|
class MediaListItemModel extends BaseEpisodeItem {
|
||||||
|
@override
|
||||||
int? get id => aid;
|
int? get id => aid;
|
||||||
int? aid;
|
|
||||||
int? offset;
|
int? offset;
|
||||||
int? index;
|
int? index;
|
||||||
String? intro;
|
String? intro;
|
||||||
@@ -17,32 +17,27 @@ class MediaListItemModel {
|
|||||||
int? tid;
|
int? tid;
|
||||||
int? copyRight;
|
int? copyRight;
|
||||||
CntInfo? cntInfo;
|
CntInfo? cntInfo;
|
||||||
String? cover;
|
|
||||||
int? duration;
|
int? duration;
|
||||||
int? pubtime;
|
int? pubtime;
|
||||||
int? likeState;
|
int? likeState;
|
||||||
int? favState;
|
int? favState;
|
||||||
int? page;
|
int? page;
|
||||||
List<Page>? pages;
|
List<Page>? pages;
|
||||||
String? title;
|
|
||||||
int? type;
|
int? type;
|
||||||
Owner? upper;
|
Owner? upper;
|
||||||
String? link;
|
String? link;
|
||||||
String? bvid;
|
|
||||||
String? shortLink;
|
String? shortLink;
|
||||||
Rights? rights;
|
Rights? rights;
|
||||||
dynamic elecInfo;
|
dynamic elecInfo;
|
||||||
Coin? coin;
|
Coin? coin;
|
||||||
OgvInfo? ogvInfo;
|
OgvInfo? ogvInfo;
|
||||||
double? progressPercent;
|
double? progressPercent;
|
||||||
Badge? badge;
|
|
||||||
bool? forbidFav;
|
bool? forbidFav;
|
||||||
int? moreType;
|
int? moreType;
|
||||||
int? businessOid;
|
int? businessOid;
|
||||||
int? cid;
|
|
||||||
|
|
||||||
MediaListItemModel({
|
MediaListItemModel({
|
||||||
this.aid,
|
super.aid,
|
||||||
this.offset,
|
this.offset,
|
||||||
this.index,
|
this.index,
|
||||||
this.intro,
|
this.intro,
|
||||||
@@ -50,29 +45,29 @@ class MediaListItemModel {
|
|||||||
this.tid,
|
this.tid,
|
||||||
this.copyRight,
|
this.copyRight,
|
||||||
this.cntInfo,
|
this.cntInfo,
|
||||||
this.cover,
|
super.cover,
|
||||||
this.duration,
|
this.duration,
|
||||||
this.pubtime,
|
this.pubtime,
|
||||||
this.likeState,
|
this.likeState,
|
||||||
this.favState,
|
this.favState,
|
||||||
this.page,
|
this.page,
|
||||||
this.pages,
|
this.pages,
|
||||||
this.title,
|
super.title,
|
||||||
this.type,
|
this.type,
|
||||||
this.upper,
|
this.upper,
|
||||||
this.link,
|
this.link,
|
||||||
this.bvid,
|
super.bvid,
|
||||||
this.shortLink,
|
this.shortLink,
|
||||||
this.rights,
|
this.rights,
|
||||||
this.elecInfo,
|
this.elecInfo,
|
||||||
this.coin,
|
this.coin,
|
||||||
this.ogvInfo,
|
this.ogvInfo,
|
||||||
this.progressPercent,
|
this.progressPercent,
|
||||||
this.badge,
|
super.badge,
|
||||||
this.forbidFav,
|
this.forbidFav,
|
||||||
this.moreType,
|
this.moreType,
|
||||||
this.businessOid,
|
this.businessOid,
|
||||||
this.cid,
|
super.cid,
|
||||||
});
|
});
|
||||||
|
|
||||||
MediaListItemModel.fromJson(Map<String, dynamic> json) {
|
MediaListItemModel.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -106,7 +101,7 @@ class MediaListItemModel {
|
|||||||
? null
|
? null
|
||||||
: OgvInfo.fromJson(json['ogv_info']);
|
: OgvInfo.fromJson(json['ogv_info']);
|
||||||
progressPercent = (json['progress_percent'] as num?)?.toDouble();
|
progressPercent = (json['progress_percent'] as num?)?.toDouble();
|
||||||
badge = json['badge'] == null ? null : Badge.fromJson(json['badge']);
|
badge = json['badge']?['text'];
|
||||||
forbidFav = json['forbid_fav'] as bool?;
|
forbidFav = json['forbid_fav'] as bool?;
|
||||||
moreType = json['more_type'] as int?;
|
moreType = json['more_type'] as int?;
|
||||||
businessOid = json['business_oid'] as int?;
|
businessOid = json['business_oid'] as int?;
|
||||||
|
|||||||
@@ -8,11 +8,9 @@ import 'package:PiliPlus/models_new/video/video_detail/episode.dart'
|
|||||||
class EpisodeItem extends BaseEpisodeItem {
|
class EpisodeItem extends BaseEpisodeItem {
|
||||||
BadgeInfo? badgeInfo;
|
BadgeInfo? badgeInfo;
|
||||||
int? badgeType;
|
int? badgeType;
|
||||||
String? cover;
|
|
||||||
Dimension? dimension;
|
Dimension? dimension;
|
||||||
int? duration;
|
int? duration;
|
||||||
bool? enableVt;
|
bool? enableVt;
|
||||||
int? epId;
|
|
||||||
String? from;
|
String? from;
|
||||||
bool? isViewHide;
|
bool? isViewHide;
|
||||||
String? link;
|
String? link;
|
||||||
@@ -39,11 +37,11 @@ class EpisodeItem extends BaseEpisodeItem {
|
|||||||
this.badgeType,
|
this.badgeType,
|
||||||
super.bvid,
|
super.bvid,
|
||||||
super.cid,
|
super.cid,
|
||||||
this.cover,
|
super.cover,
|
||||||
this.dimension,
|
this.dimension,
|
||||||
this.duration,
|
this.duration,
|
||||||
this.enableVt,
|
this.enableVt,
|
||||||
this.epId,
|
super.epId,
|
||||||
this.from,
|
this.from,
|
||||||
super.id,
|
super.id,
|
||||||
this.isViewHide,
|
this.isViewHide,
|
||||||
|
|||||||
@@ -1,21 +1,25 @@
|
|||||||
import 'package:PiliPlus/models_new/video/video_detail/arc.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/arc.dart';
|
||||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||||
|
|
||||||
abstract class BaseEpisodeItem {
|
class BaseEpisodeItem {
|
||||||
int? id;
|
int? id;
|
||||||
int? aid;
|
int? aid;
|
||||||
int? cid;
|
int? cid;
|
||||||
|
int? epId;
|
||||||
String? bvid;
|
String? bvid;
|
||||||
String? badge;
|
String? badge;
|
||||||
String? title;
|
String? title;
|
||||||
|
String? cover;
|
||||||
|
|
||||||
BaseEpisodeItem({
|
BaseEpisodeItem({
|
||||||
this.id,
|
this.id,
|
||||||
this.aid,
|
this.aid,
|
||||||
this.cid,
|
this.cid,
|
||||||
|
this.epId,
|
||||||
this.bvid,
|
this.bvid,
|
||||||
this.badge,
|
this.badge,
|
||||||
this.title,
|
this.title,
|
||||||
|
this.cover,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,6 +30,8 @@ class EpisodeItem extends BaseEpisodeItem {
|
|||||||
Arc? arc;
|
Arc? arc;
|
||||||
Part? page;
|
Part? page;
|
||||||
List<Part>? pages;
|
List<Part>? pages;
|
||||||
|
@override
|
||||||
|
String? get cover => arc?.pic;
|
||||||
|
|
||||||
EpisodeItem({
|
EpisodeItem({
|
||||||
this.seasonId,
|
this.seasonId,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
|
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
|
||||||
|
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||||
|
|
||||||
class Part {
|
class Part extends BaseEpisodeItem {
|
||||||
int? cid;
|
|
||||||
int? page;
|
int? page;
|
||||||
String? from;
|
String? from;
|
||||||
String? pagePart;
|
String? pagePart;
|
||||||
@@ -11,10 +11,9 @@ class Part {
|
|||||||
Dimension? dimension;
|
Dimension? dimension;
|
||||||
int? ctime;
|
int? ctime;
|
||||||
String? firstFrame;
|
String? firstFrame;
|
||||||
String? badge;
|
|
||||||
|
|
||||||
Part({
|
Part({
|
||||||
this.cid,
|
super.cid,
|
||||||
this.page,
|
this.page,
|
||||||
this.from,
|
this.from,
|
||||||
this.pagePart,
|
this.pagePart,
|
||||||
@@ -24,7 +23,7 @@ class Part {
|
|||||||
this.dimension,
|
this.dimension,
|
||||||
this.ctime,
|
this.ctime,
|
||||||
this.firstFrame,
|
this.firstFrame,
|
||||||
this.badge,
|
super.badge,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory Part.fromJson(Map<String, dynamic> json) => Part(
|
factory Part.fromJson(Map<String, dynamic> json) => Part(
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
class Choice {
|
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||||
int? id;
|
|
||||||
|
class Choice extends BaseEpisodeItem {
|
||||||
String? platformAction;
|
String? platformAction;
|
||||||
String? nativeAction;
|
String? nativeAction;
|
||||||
String? condition;
|
String? condition;
|
||||||
int? cid;
|
|
||||||
String? option;
|
String? option;
|
||||||
int? isDefault;
|
int? isDefault;
|
||||||
|
|
||||||
Choice({
|
Choice({
|
||||||
this.id,
|
super.id,
|
||||||
this.platformAction,
|
this.platformAction,
|
||||||
this.nativeAction,
|
this.nativeAction,
|
||||||
this.condition,
|
this.condition,
|
||||||
this.cid,
|
super.cid,
|
||||||
this.option,
|
this.option,
|
||||||
this.isDefault,
|
this.isDefault,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class EpisodePanel extends CommonSlidePage {
|
|||||||
final int initialTabIndex;
|
final int initialTabIndex;
|
||||||
final bool? isSupportReverse;
|
final bool? isSupportReverse;
|
||||||
final bool? isReversed;
|
final bool? isReversed;
|
||||||
final Function onChangeEpisode;
|
final ValueChanged<ugc.BaseEpisodeItem> onChangeEpisode;
|
||||||
final VoidCallback? onReverse;
|
final VoidCallback? onReverse;
|
||||||
final VoidCallback? onClose;
|
final VoidCallback? onClose;
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ class _EpisodePanelState extends CommonSlidePageState<EpisodePanel> {
|
|||||||
|
|
||||||
Widget _buildEpisodeItem({
|
Widget _buildEpisodeItem({
|
||||||
required ThemeData theme,
|
required ThemeData theme,
|
||||||
required dynamic episode,
|
required ugc.BaseEpisodeItem episode,
|
||||||
required int index,
|
required int index,
|
||||||
required int length,
|
required int length,
|
||||||
required bool isCurrentIndex,
|
required bool isCurrentIndex,
|
||||||
@@ -379,7 +379,7 @@ class _EpisodePanelState extends CommonSlidePageState<EpisodePanel> {
|
|||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (episode.badge != null && episode.badge == "会员") {
|
if (episode.badge == "会员") {
|
||||||
UserInfoData? userInfo = GStorage.userInfo.get('userInfoCache');
|
UserInfoData? userInfo = GStorage.userInfo.get('userInfoCache');
|
||||||
int vipStatus = userInfo?.vipStatus ?? 0;
|
int vipStatus = userInfo?.vipStatus ?? 0;
|
||||||
if (vipStatus != 1) {
|
if (vipStatus != 1) {
|
||||||
@@ -392,14 +392,7 @@ class _EpisodePanelState extends CommonSlidePageState<EpisodePanel> {
|
|||||||
if (!widget.showTitle) {
|
if (!widget.showTitle) {
|
||||||
_currentItemIndex = index;
|
_currentItemIndex = index;
|
||||||
}
|
}
|
||||||
final isEpisode = episode is ugc.BaseEpisodeItem;
|
widget.onChangeEpisode(episode);
|
||||||
widget.onChangeEpisode(
|
|
||||||
episode is pgc.EpisodeItem ? episode.epId : null,
|
|
||||||
isEpisode ? episode.bvid : widget.bvid,
|
|
||||||
episode.cid,
|
|
||||||
isEpisode ? episode.aid : widget.aid,
|
|
||||||
cover,
|
|
||||||
);
|
|
||||||
if (widget.type == EpisodeType.season) {
|
if (widget.type == EpisodeType.season) {
|
||||||
try {
|
try {
|
||||||
Get.find<VideoDetailController>(
|
Get.find<VideoDetailController>(
|
||||||
|
|||||||
@@ -329,29 +329,23 @@ class VideoDetailController extends GetxController
|
|||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
MediaListData data = res['data'];
|
MediaListData data = res['data'];
|
||||||
if (data.mediaList?.isNotEmpty == true) {
|
if (data.mediaList.isNotEmpty) {
|
||||||
if (isReverse) {
|
if (isReverse) {
|
||||||
mediaList.value = data.mediaList!;
|
mediaList.value = data.mediaList;
|
||||||
try {
|
|
||||||
for (var item in mediaList) {
|
for (var item in mediaList) {
|
||||||
if (item.cid != null) {
|
if (item.cid != null) {
|
||||||
|
try {
|
||||||
Get.find<UgcIntroController>(
|
Get.find<UgcIntroController>(
|
||||||
tag: heroTag,
|
tag: heroTag,
|
||||||
).onChangeEpisode(
|
).onChangeEpisode(item);
|
||||||
null,
|
} catch (_) {}
|
||||||
item.bvid,
|
|
||||||
item.cid,
|
|
||||||
item.aid,
|
|
||||||
item.cover,
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
|
||||||
} else if (isLoadPrevious) {
|
} else if (isLoadPrevious) {
|
||||||
mediaList.insertAll(0, data.mediaList!);
|
mediaList.insertAll(0, data.mediaList);
|
||||||
} else {
|
} else {
|
||||||
mediaList.addAll(data.mediaList!);
|
mediaList.addAll(data.mediaList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -364,11 +358,9 @@ class VideoDetailController extends GetxController
|
|||||||
if (mediaList.isNotEmpty) {
|
if (mediaList.isNotEmpty) {
|
||||||
Widget panel() => MediaListPanel(
|
Widget panel() => MediaListPanel(
|
||||||
mediaList: mediaList,
|
mediaList: mediaList,
|
||||||
changeMediaList: (bvid, cid, aid, cover) {
|
onChangeEpisode: (episode) {
|
||||||
try {
|
try {
|
||||||
Get.find<UgcIntroController>(
|
Get.find<UgcIntroController>(tag: heroTag).onChangeEpisode(episode);
|
||||||
tag: heroTag,
|
|
||||||
).onChangeEpisode(null, bvid, cid, aid, cover);
|
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
},
|
},
|
||||||
panelTitle: watchLaterTitle,
|
panelTitle: watchLaterTitle,
|
||||||
@@ -904,13 +896,7 @@ class VideoDetailController extends GetxController
|
|||||||
Get.find<UgcIntroController>(tag: heroTag);
|
Get.find<UgcIntroController>(tag: heroTag);
|
||||||
Part part =
|
Part part =
|
||||||
ugcIntroController.videoDetail.value.pages![item];
|
ugcIntroController.videoDetail.value.pages![item];
|
||||||
ugcIntroController.onChangeEpisode(
|
ugcIntroController.onChangeEpisode(part);
|
||||||
null,
|
|
||||||
bvid,
|
|
||||||
part.cid,
|
|
||||||
IdUtils.bv2av(bvid),
|
|
||||||
null,
|
|
||||||
);
|
|
||||||
SmartDialog.showToast('已跳至第${item + 1}P');
|
SmartDialog.showToast('已跳至第${item + 1}P');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (kDebugMode) debugPrint('$e');
|
if (kDebugMode) debugPrint('$e');
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ import 'package:PiliPlus/grpc/bilibili/app/viewunite/pgcanymodel.pb.dart'
|
|||||||
show ViewPgcAny;
|
show ViewPgcAny;
|
||||||
import 'package:PiliPlus/grpc/view.dart';
|
import 'package:PiliPlus/grpc/view.dart';
|
||||||
import 'package:PiliPlus/http/constants.dart';
|
import 'package:PiliPlus/http/constants.dart';
|
||||||
|
import 'package:PiliPlus/http/search.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/pgc_lcf.dart';
|
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/episode.dart'
|
||||||
|
hide EpisodeItem;
|
||||||
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';
|
||||||
@@ -20,6 +23,7 @@ import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
|||||||
import 'package:PiliPlus/services/service_locator.dart';
|
import 'package:PiliPlus/services/service_locator.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
import 'package:PiliPlus/utils/global_data.dart';
|
import 'package:PiliPlus/utils/global_data.dart';
|
||||||
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/page_utils.dart';
|
import 'package:PiliPlus/utils/page_utils.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -257,7 +261,18 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改分P或番剧分集
|
// 修改分P或番剧分集
|
||||||
void onChangeEpisode(dynamic epId, bvid, cid, aid, cover) {
|
Future<void> onChangeEpisode(BaseEpisodeItem episode) async {
|
||||||
|
try {
|
||||||
|
final int epId = episode.epId!;
|
||||||
|
final String bvid = episode.bvid ?? this.bvid;
|
||||||
|
final int aid = episode.aid ?? IdUtils.bv2av(bvid);
|
||||||
|
final int? cid =
|
||||||
|
episode.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||||
|
if (cid == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final String? cover = episode.cover;
|
||||||
|
|
||||||
// 重新获取视频资源
|
// 重新获取视频资源
|
||||||
this.epId = epId;
|
this.epId = epId;
|
||||||
this.bvid = bvid;
|
this.bvid = bvid;
|
||||||
@@ -271,7 +286,7 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
..bvid = bvid
|
..bvid = bvid
|
||||||
..cid.value = cid
|
..cid.value = cid
|
||||||
..queryVideoUrl();
|
..queryVideoUrl();
|
||||||
if (cover is String && cover.isNotEmpty) {
|
if (cover != null && cover.isNotEmpty) {
|
||||||
videoDetailCtr.cover.value = cover;
|
videoDetailCtr.cover.value = cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,6 +307,9 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
this.cid.value = cid;
|
this.cid.value = cid;
|
||||||
queryVideoIntro();
|
queryVideoIntro();
|
||||||
queryOnlineTotal();
|
queryOnlineTotal();
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint('pgc onChangeEpisode: $e');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 追番
|
// 追番
|
||||||
@@ -342,14 +360,7 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final episode = episodes[prevIndex];
|
onChangeEpisode(episodes[prevIndex]);
|
||||||
onChangeEpisode(
|
|
||||||
episode.epId,
|
|
||||||
episode.bvid,
|
|
||||||
episode.cid,
|
|
||||||
episode.aid,
|
|
||||||
episode.cover,
|
|
||||||
);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,14 +388,7 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final episode = episodes[nextIndex];
|
onChangeEpisode(episodes[nextIndex]);
|
||||||
onChangeEpisode(
|
|
||||||
episode.epId,
|
|
||||||
episode.bvid,
|
|
||||||
episode.cid,
|
|
||||||
episode.aid,
|
|
||||||
episode.cover,
|
|
||||||
);
|
|
||||||
return true;
|
return true;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import 'dart:async';
|
|||||||
import 'package:PiliPlus/models/user/info.dart';
|
import 'package:PiliPlus/models/user/info.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/new_ep.dart';
|
import 'package:PiliPlus/models_new/pgc/pgc_info_model/new_ep.dart';
|
||||||
|
import 'package:PiliPlus/models_new/video/video_detail/episode.dart'
|
||||||
|
hide EpisodeItem;
|
||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
@@ -23,7 +25,7 @@ class PgcPanel extends StatefulWidget {
|
|||||||
|
|
||||||
final List<EpisodeItem> pages;
|
final List<EpisodeItem> pages;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final Function onChangeEpisode;
|
final ValueChanged<BaseEpisodeItem> onChangeEpisode;
|
||||||
final Function showEpisodes;
|
final Function showEpisodes;
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
final NewEp? newEp;
|
final NewEp? newEp;
|
||||||
@@ -149,18 +151,10 @@ class _PgcPanelState extends State<PgcPanel> {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (item.badge != null &&
|
if (item.badge == '会员' && vipStatus != 1) {
|
||||||
item.badge == '会员' &&
|
|
||||||
vipStatus != 1) {
|
|
||||||
SmartDialog.showToast('需要大会员');
|
SmartDialog.showToast('需要大会员');
|
||||||
}
|
}
|
||||||
widget.onChangeEpisode(
|
widget.onChangeEpisode(item);
|
||||||
item.epId,
|
|
||||||
item.bvid,
|
|
||||||
item.cid,
|
|
||||||
item.aid,
|
|
||||||
item.cover,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
|
|||||||
@@ -465,7 +465,17 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改分P或番剧分集
|
// 修改分P或番剧分集
|
||||||
bool onChangeEpisode(dynamic epid, bvid, cid, aid, cover, [isStein]) {
|
Future<void> onChangeEpisode(BaseEpisodeItem episode, {bool? isStein}) async {
|
||||||
|
try {
|
||||||
|
final String bvid = episode.bvid ?? this.bvid;
|
||||||
|
final int aid = episode.aid ?? IdUtils.bv2av(bvid);
|
||||||
|
final int? cid =
|
||||||
|
episode.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||||
|
if (cid == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final String? cover = episode.cover;
|
||||||
|
|
||||||
// 重新获取视频资源
|
// 重新获取视频资源
|
||||||
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
||||||
|
|
||||||
@@ -475,11 +485,11 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
PageUtils.toVideoPage(
|
PageUtils.toVideoPage(
|
||||||
'bvid=$bvid&cid=$cid',
|
'bvid=$bvid&cid=$cid',
|
||||||
arguments: {
|
arguments: {
|
||||||
'pic': cover,
|
'pic': ?cover,
|
||||||
'heroTag': Utils.makeHeroTag(bvid),
|
'heroTag': Utils.makeHeroTag(bvid),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,7 +499,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
..updateMediaListHistory(aid)
|
..updateMediaListHistory(aid)
|
||||||
..onReset(isStein)
|
..onReset(isStein)
|
||||||
..bvid = bvid
|
..bvid = bvid
|
||||||
..oid.value = aid ?? IdUtils.bv2av(bvid)
|
..oid.value = aid
|
||||||
..cid.value = cid
|
..cid.value = cid
|
||||||
..queryVideoUrl();
|
..queryVideoUrl();
|
||||||
|
|
||||||
@@ -497,7 +507,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
reload = true;
|
reload = true;
|
||||||
aiConclusionResult = null;
|
aiConclusionResult = null;
|
||||||
|
|
||||||
if (cover is String && cover.isNotEmpty) {
|
if (cover != null && cover.isNotEmpty) {
|
||||||
videoDetailCtr.cover.value = cover;
|
videoDetailCtr.cover.value = cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,7 +536,9 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
|
|
||||||
this.cid.value = cid;
|
this.cid.value = cid;
|
||||||
queryOnlineTotal();
|
queryOnlineTotal();
|
||||||
return true;
|
} catch (e) {
|
||||||
|
debugPrint('ugc onChangeEpisode: $e');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -538,7 +550,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
/// 播放上一个
|
/// 播放上一个
|
||||||
@override
|
@override
|
||||||
bool prevPlay([bool skipPages = false]) {
|
bool prevPlay([bool skipPages = false]) {
|
||||||
final List episodes = [];
|
final List<BaseEpisodeItem> episodes = <BaseEpisodeItem>[];
|
||||||
bool isPages = false;
|
bool isPages = false;
|
||||||
|
|
||||||
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
||||||
@@ -566,7 +578,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
? videoDetail.isPageReversed == true
|
? videoDetail.isPageReversed == true
|
||||||
? videoDetail.pages!.last.cid
|
? videoDetail.pages!.last.cid
|
||||||
: videoDetail.pages!.first.cid
|
: videoDetail.pages!.first.cid
|
||||||
: this.cid.value),
|
: cid.value),
|
||||||
);
|
);
|
||||||
int prevIndex = currentIndex - 1;
|
int prevIndex = currentIndex - 1;
|
||||||
final PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;
|
final PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;
|
||||||
@@ -583,10 +595,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final int cid = episodes[prevIndex].cid!;
|
onChangeEpisode(episodes[prevIndex]);
|
||||||
final String rBvid = isPages ? bvid : episodes[prevIndex].bvid;
|
|
||||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[prevIndex].aid!;
|
|
||||||
onChangeEpisode(null, rBvid, cid, rAid, null);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,7 +603,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
@override
|
@override
|
||||||
bool nextPlay([bool skipPages = false]) {
|
bool nextPlay([bool skipPages = false]) {
|
||||||
try {
|
try {
|
||||||
final List episodes = [];
|
final List<BaseEpisodeItem> episodes = <BaseEpisodeItem>[];
|
||||||
bool isPages = false;
|
bool isPages = false;
|
||||||
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
final videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
||||||
final videoDetail = this.videoDetail.value;
|
final videoDetail = this.videoDetail.value;
|
||||||
@@ -671,10 +680,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
}
|
}
|
||||||
cid = episodes[nextIndex].cid!;
|
cid = episodes[nextIndex].cid!;
|
||||||
}
|
}
|
||||||
|
onChangeEpisode(episodes[nextIndex]);
|
||||||
final String rBvid = isPages ? bvid : episodes[nextIndex].bvid;
|
|
||||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
|
||||||
onChangeEpisode(null, rBvid, cid, rAid, null);
|
|
||||||
return true;
|
return true;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return false;
|
return false;
|
||||||
@@ -703,29 +709,14 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final firstItem = relatedCtr.loadingState.value.data!.first;
|
final firstItem = relatedCtr.loadingState.value.data!.first;
|
||||||
try {
|
|
||||||
if (firstItem.cid != null) {
|
|
||||||
onChangeEpisode(
|
onChangeEpisode(
|
||||||
null,
|
BaseEpisodeItem(
|
||||||
firstItem.bvid,
|
aid: firstItem.aid,
|
||||||
firstItem.cid,
|
bvid: firstItem.bvid,
|
||||||
firstItem.aid,
|
cid: firstItem.cid,
|
||||||
firstItem.cover,
|
cover: firstItem.cover,
|
||||||
);
|
|
||||||
} else {
|
|
||||||
SearchHttp.ab2c(aid: firstItem.aid, bvid: firstItem.bvid).then(
|
|
||||||
(cid) => onChangeEpisode(
|
|
||||||
null,
|
|
||||||
firstItem.bvid,
|
|
||||||
cid,
|
|
||||||
firstItem.aid,
|
|
||||||
firstItem.cover,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
SmartDialog.showToast(err.toString());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,6 @@ class _UgcIntroPanelState extends State<UgcIntroPanel>
|
|||||||
.horizontalSeasonPanel))
|
.horizontalSeasonPanel))
|
||||||
SeasonPanel(
|
SeasonPanel(
|
||||||
heroTag: widget.heroTag,
|
heroTag: widget.heroTag,
|
||||||
onChangeEpisode: ugcIntroController.onChangeEpisode,
|
|
||||||
showEpisodes: widget.showEpisodes,
|
showEpisodes: widget.showEpisodes,
|
||||||
ugcIntroController: ugcIntroController,
|
ugcIntroController: ugcIntroController,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -156,13 +156,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
|||||||
if (widget.showEpisodes == null) {
|
if (widget.showEpisodes == null) {
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
widget.ugcIntroController.onChangeEpisode(
|
widget.ugcIntroController.onChangeEpisode(item);
|
||||||
null,
|
|
||||||
widget.bvid,
|
|
||||||
item.cid,
|
|
||||||
IdUtils.bv2av(widget.bvid),
|
|
||||||
widget.cover,
|
|
||||||
);
|
|
||||||
if (widget.list != null &&
|
if (widget.list != null &&
|
||||||
widget
|
widget
|
||||||
.ugcIntroController
|
.ugcIntroController
|
||||||
|
|||||||
@@ -11,13 +11,11 @@ import 'package:get/get.dart';
|
|||||||
class SeasonPanel extends StatefulWidget {
|
class SeasonPanel extends StatefulWidget {
|
||||||
const SeasonPanel({
|
const SeasonPanel({
|
||||||
super.key,
|
super.key,
|
||||||
required this.onChangeEpisode,
|
|
||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
required this.showEpisodes,
|
required this.showEpisodes,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
required this.ugcIntroController,
|
required this.ugcIntroController,
|
||||||
});
|
});
|
||||||
final Function onChangeEpisode;
|
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
final Function showEpisodes;
|
final Function showEpisodes;
|
||||||
final bool? onTap;
|
final bool? onTap;
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||||
import 'package:PiliPlus/http/search.dart';
|
|
||||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||||
import 'package:PiliPlus/models/common/stat_type.dart';
|
import 'package:PiliPlus/models/common/stat_type.dart';
|
||||||
import 'package:PiliPlus/models_new/media_list/media_list.dart';
|
import 'package:PiliPlus/models_new/media_list/media_list.dart';
|
||||||
|
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
||||||
import 'package:PiliPlus/utils/duration_util.dart';
|
import 'package:PiliPlus/utils/duration_util.dart';
|
||||||
import 'package:flutter/material.dart' hide RefreshCallback;
|
import 'package:flutter/material.dart' hide RefreshCallback;
|
||||||
@@ -22,7 +22,7 @@ class MediaListPanel extends CommonCollapseSlidePage {
|
|||||||
const MediaListPanel({
|
const MediaListPanel({
|
||||||
super.key,
|
super.key,
|
||||||
required this.mediaList,
|
required this.mediaList,
|
||||||
this.changeMediaList,
|
required this.onChangeEpisode,
|
||||||
this.panelTitle,
|
this.panelTitle,
|
||||||
required this.getBvId,
|
required this.getBvId,
|
||||||
required this.loadMoreMedia,
|
required this.loadMoreMedia,
|
||||||
@@ -34,7 +34,7 @@ class MediaListPanel extends CommonCollapseSlidePage {
|
|||||||
});
|
});
|
||||||
|
|
||||||
final List<MediaListItemModel> mediaList;
|
final List<MediaListItemModel> mediaList;
|
||||||
final Function? changeMediaList;
|
final ValueChanged<BaseEpisodeItem> onChangeEpisode;
|
||||||
final String? panelTitle;
|
final String? panelTitle;
|
||||||
final Function getBvId;
|
final Function getBvId;
|
||||||
final VoidCallback loadMoreMedia;
|
final VoidCallback loadMoreMedia;
|
||||||
@@ -162,20 +162,13 @@ class _MediaListPanelState
|
|||||||
child: Material(
|
child: Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () {
|
||||||
if (item.type != 2) {
|
if (item.type != 2) {
|
||||||
SmartDialog.showToast('不支持播放该类型视频');
|
SmartDialog.showToast('不支持播放该类型视频');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Get.back();
|
Get.back();
|
||||||
String bvid = item.bvid!;
|
widget.onChangeEpisode(item);
|
||||||
int? aid = item.aid;
|
|
||||||
String cover = item.cover ?? '';
|
|
||||||
final int? cid =
|
|
||||||
item.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
|
||||||
if (cid != null) {
|
|
||||||
widget.changeMediaList?.call(bvid, cid, aid, cover);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLongPress: () => imageSaveDialog(
|
onLongPress: () => imageSaveDialog(
|
||||||
title: item.title,
|
title: item.title,
|
||||||
@@ -206,12 +199,12 @@ class _MediaListPanelState
|
|||||||
width: boxConstraints.maxWidth,
|
width: boxConstraints.maxWidth,
|
||||||
height: boxConstraints.maxHeight,
|
height: boxConstraints.maxHeight,
|
||||||
),
|
),
|
||||||
if (item.badge?.text?.isNotEmpty == true)
|
if (item.badge?.isNotEmpty == true)
|
||||||
PBadge(
|
PBadge(
|
||||||
text: item.badge?.text,
|
text: item.badge,
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
top: 6.0,
|
top: 6.0,
|
||||||
type: switch (item.badge?.text) {
|
type: switch (item.badge) {
|
||||||
'充电专属' => PBadgeType.error,
|
'充电专属' => PBadgeType.error,
|
||||||
_ => PBadgeType.primary,
|
_ => PBadgeType.primary,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:PiliPlus/models/common/image_preview_type.dart';
|
|||||||
import 'package:PiliPlus/models/common/image_type.dart';
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/member/info.dart';
|
import 'package:PiliPlus/models/member/info.dart';
|
||||||
import 'package:PiliPlus/models_new/space/space_archive/item.dart';
|
import 'package:PiliPlus/models_new/space/space_archive/item.dart';
|
||||||
|
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||||
import 'package:PiliPlus/pages/member_video/widgets/video_card_h_member_video.dart';
|
import 'package:PiliPlus/pages/member_video/widgets/video_card_h_member_video.dart';
|
||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||||
@@ -17,7 +18,6 @@ import 'package:PiliPlus/pages/video/member/controller.dart';
|
|||||||
import 'package:PiliPlus/services/account_service.dart';
|
import 'package:PiliPlus/services/account_service.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/grid.dart';
|
import 'package:PiliPlus/utils/grid.dart';
|
||||||
import 'package:PiliPlus/utils/id_utils.dart';
|
|
||||||
import 'package:PiliPlus/utils/num_util.dart';
|
import 'package:PiliPlus/utils/num_util.dart';
|
||||||
import 'package:PiliPlus/utils/request_utils.dart';
|
import 'package:PiliPlus/utils/request_utils.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
@@ -200,18 +200,14 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
|||||||
videoItem: videoItem,
|
videoItem: videoItem,
|
||||||
bvid: _bvid,
|
bvid: _bvid,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final status = widget.ugcIntroController
|
Get.back();
|
||||||
.onChangeEpisode(
|
widget.ugcIntroController.onChangeEpisode(
|
||||||
null,
|
BaseEpisodeItem(
|
||||||
videoItem.bvid,
|
bvid: videoItem.bvid,
|
||||||
videoItem.cid,
|
cid: videoItem.cid,
|
||||||
IdUtils.bv2av(videoItem.bvid!),
|
cover: videoItem.cover,
|
||||||
videoItem.cover,
|
),
|
||||||
);
|
);
|
||||||
if (status) {
|
|
||||||
_bvid = videoItem.bvid;
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/main.dart';
|
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/episode.dart' as pgc;
|
|
||||||
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/episode.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_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';
|
||||||
@@ -1771,12 +1769,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
ugcIntroController.onChangeEpisode(
|
ugcIntroController.onChangeEpisode(
|
||||||
null,
|
item,
|
||||||
videoDetailController.bvid,
|
isStein: true,
|
||||||
item.cid,
|
|
||||||
IdUtils.bv2av(videoDetailController.bvid),
|
|
||||||
null,
|
|
||||||
true,
|
|
||||||
);
|
);
|
||||||
videoDetailController.getSteinEdgeInfo(
|
videoDetailController.getSteinEdgeInfo(
|
||||||
item.id,
|
item.id,
|
||||||
@@ -1968,7 +1962,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
child: SeasonPanel(
|
child: SeasonPanel(
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
onTap: false,
|
onTap: false,
|
||||||
onChangeEpisode: ugcIntroController.onChangeEpisode,
|
|
||||||
showEpisodes: showEpisodes,
|
showEpisodes: showEpisodes,
|
||||||
ugcIntroController: ugcIntroController,
|
ugcIntroController: ugcIntroController,
|
||||||
),
|
),
|
||||||
@@ -2153,22 +2146,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void onChangeEpisode(episode) {
|
|
||||||
final isEpisode = episode is BaseEpisodeItem;
|
|
||||||
final isPgc = episode is pgc.EpisodeItem;
|
|
||||||
ugcIntroController.onChangeEpisode(
|
|
||||||
isPgc ? episode.epId : null,
|
|
||||||
isEpisode ? episode.bvid : bvid,
|
|
||||||
episode.cid,
|
|
||||||
isEpisode ? episode.aid : aid,
|
|
||||||
episode is EpisodeItem
|
|
||||||
? episode.arc?.pic
|
|
||||||
: isPgc
|
|
||||||
? episode.cover
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final videoDetail = ugcIntroController.videoDetail.value;
|
final videoDetail = ugcIntroController.videoDetail.value;
|
||||||
if (isSeason) {
|
if (isSeason) {
|
||||||
// reverse season
|
// reverse season
|
||||||
@@ -2194,7 +2171,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
.episodes!
|
.episodes!
|
||||||
.first;
|
.first;
|
||||||
if (episode.cid != videoDetailController.cid.value) {
|
if (episode.cid != videoDetailController.cid.value) {
|
||||||
onChangeEpisode(episode);
|
ugcIntroController.onChangeEpisode(episode);
|
||||||
videoDetailController.seasonCid = episode.cid;
|
videoDetailController.seasonCid = episode.cid;
|
||||||
} else {
|
} else {
|
||||||
videoDetailController
|
videoDetailController
|
||||||
@@ -2214,7 +2191,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
// switch to first episode
|
// switch to first episode
|
||||||
var episode = videoDetail.pages!.first;
|
var episode = videoDetail.pages!.first;
|
||||||
if (episode.cid != videoDetailController.cid.value) {
|
if (episode.cid != videoDetailController.cid.value) {
|
||||||
onChangeEpisode(episode);
|
ugcIntroController.onChangeEpisode(episode);
|
||||||
} else {
|
} else {
|
||||||
videoDetailController.cid.refresh();
|
videoDetailController.cid.refresh();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class BackwardSeekIndicatorState extends State<BackwardSeekIndicator> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
duration = Duration(seconds: widget.duration);
|
duration = Duration(seconds: widget.duration);
|
||||||
timer = Timer(const Duration(milliseconds: 400), () {
|
timer = Timer(const Duration(milliseconds: 400), () {
|
||||||
widget.onSubmitted.call(duration);
|
widget.onSubmitted(duration);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class BackwardSeekIndicatorState extends State<BackwardSeekIndicator> {
|
|||||||
void increment() {
|
void increment() {
|
||||||
timer?.cancel();
|
timer?.cancel();
|
||||||
timer = Timer(const Duration(milliseconds: 400), () {
|
timer = Timer(const Duration(milliseconds: 400), () {
|
||||||
widget.onSubmitted.call(duration);
|
widget.onSubmitted(duration);
|
||||||
});
|
});
|
||||||
setState(() {
|
setState(() {
|
||||||
duration += Duration(seconds: widget.duration);
|
duration += Duration(seconds: widget.duration);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class ForwardSeekIndicatorState extends State<ForwardSeekIndicator> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
duration = Duration(seconds: widget.duration);
|
duration = Duration(seconds: widget.duration);
|
||||||
timer = Timer(const Duration(milliseconds: 400), () {
|
timer = Timer(const Duration(milliseconds: 400), () {
|
||||||
widget.onSubmitted.call(duration);
|
widget.onSubmitted(duration);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class ForwardSeekIndicatorState extends State<ForwardSeekIndicator> {
|
|||||||
void increment() {
|
void increment() {
|
||||||
timer?.cancel();
|
timer?.cancel();
|
||||||
timer = Timer(const Duration(milliseconds: 400), () {
|
timer = Timer(const Duration(milliseconds: 400), () {
|
||||||
widget.onSubmitted.call(duration);
|
widget.onSubmitted(duration);
|
||||||
});
|
});
|
||||||
setState(() {
|
setState(() {
|
||||||
duration += Duration(seconds: widget.duration);
|
duration += Duration(seconds: widget.duration);
|
||||||
|
|||||||
Reference in New Issue
Block a user