mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: play all
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -517,6 +517,7 @@ class UserHttp {
|
|||||||
required int bizId,
|
required int bizId,
|
||||||
required int ps,
|
required int ps,
|
||||||
int? oid,
|
int? oid,
|
||||||
|
int otype = 2,
|
||||||
}) async {
|
}) async {
|
||||||
var res = await Request().get(
|
var res = await Request().get(
|
||||||
Api.mediaList,
|
Api.mediaList,
|
||||||
@@ -525,7 +526,7 @@ class UserHttp {
|
|||||||
'type': type,
|
'type': type,
|
||||||
'biz_id': bizId,
|
'biz_id': bizId,
|
||||||
'oid': oid ?? '',
|
'oid': oid ?? '',
|
||||||
'otype': 2,
|
'otype': otype, // video:2 // bangumi: 24
|
||||||
'ps': ps,
|
'ps': ps,
|
||||||
'direction': false,
|
'direction': false,
|
||||||
'desc': true,
|
'desc': true,
|
||||||
|
|||||||
@@ -127,22 +127,30 @@ class FavDetailController extends MultiSelectController {
|
|||||||
|
|
||||||
Future toViewPlayAll() async {
|
Future toViewPlayAll() async {
|
||||||
if (loadingState.value is Success) {
|
if (loadingState.value is Success) {
|
||||||
final FavDetailItemData firstItem =
|
List<FavDetailItemData> list = (loadingState.value as Success).response;
|
||||||
(loadingState.value as Success).response.first;
|
for (FavDetailItemData element in list) {
|
||||||
final String heroTag = Utils.makeHeroTag(firstItem.bvid);
|
if (element.cid == null) {
|
||||||
Get.toNamed(
|
continue;
|
||||||
'/video?bvid=${firstItem.bvid}&cid=${firstItem.cid}',
|
} else {
|
||||||
arguments: {
|
if (element.bvid != list.first.bvid) {
|
||||||
'videoItem': firstItem,
|
SmartDialog.showToast('已跳过不支持播放的视频');
|
||||||
'heroTag': heroTag,
|
}
|
||||||
'sourceType': 'fav',
|
final String heroTag = Utils.makeHeroTag(element.bvid);
|
||||||
'mediaId': item.value.id,
|
Get.toNamed(
|
||||||
'oid': firstItem.id,
|
'/video?bvid=${element.bvid}&cid=${element.cid}',
|
||||||
'favTitle': item.value.title,
|
arguments: {
|
||||||
// 'favInfo': favInfo,
|
'videoItem': element,
|
||||||
'count': item.value.mediaCount,
|
'heroTag': heroTag,
|
||||||
},
|
'sourceType': 'fav',
|
||||||
);
|
'mediaId': item.value.id,
|
||||||
|
'oid': element.id,
|
||||||
|
'favTitle': item.value.title,
|
||||||
|
'count': item.value.mediaCount,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,18 +167,27 @@ class LaterController extends MultiSelectController {
|
|||||||
// 稍后再看播放全部
|
// 稍后再看播放全部
|
||||||
Future toViewPlayAll() async {
|
Future toViewPlayAll() async {
|
||||||
if (loadingState.value is Success) {
|
if (loadingState.value is Success) {
|
||||||
final HotVideoItemModel firstItem =
|
List<HotVideoItemModel> list = (loadingState.value as Success).response;
|
||||||
(loadingState.value as Success).response.first;
|
for (HotVideoItemModel item in list) {
|
||||||
final String heroTag = Utils.makeHeroTag(firstItem.bvid);
|
if (item.cid == null) {
|
||||||
Get.toNamed(
|
continue;
|
||||||
'/video?bvid=${firstItem.bvid}&cid=${firstItem.cid}',
|
} else {
|
||||||
arguments: {
|
if (item.bvid != list.first.bvid) {
|
||||||
'videoItem': firstItem,
|
SmartDialog.showToast('已跳过不支持播放的视频');
|
||||||
'heroTag': heroTag,
|
}
|
||||||
'sourceType': 'watchLater',
|
final String heroTag = Utils.makeHeroTag(item.bvid);
|
||||||
'count': (loadingState.value as Success).response.length,
|
Get.toNamed(
|
||||||
},
|
'/video?bvid=${item.bvid}&cid=${item.cid}',
|
||||||
);
|
arguments: {
|
||||||
|
'videoItem': item,
|
||||||
|
'heroTag': heroTag,
|
||||||
|
'sourceType': 'watchLater',
|
||||||
|
'count': (loadingState.value as Success).response.length,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:PiliPalaX/common/widgets/icon_button.dart';
|
|||||||
import 'package:PiliPalaX/common/widgets/loading_widget.dart';
|
import 'package:PiliPalaX/common/widgets/loading_widget.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/pair.dart';
|
import 'package:PiliPalaX/common/widgets/pair.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/segment_progress_bar.dart';
|
import 'package:PiliPalaX/common/widgets/segment_progress_bar.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/watch_later_list.dart';
|
|
||||||
import 'package:PiliPalaX/http/danmaku.dart';
|
import 'package:PiliPalaX/http/danmaku.dart';
|
||||||
import 'package:PiliPalaX/http/init.dart';
|
import 'package:PiliPalaX/http/init.dart';
|
||||||
import 'package:PiliPalaX/http/user.dart';
|
import 'package:PiliPalaX/http/user.dart';
|
||||||
@@ -16,6 +15,7 @@ import 'package:PiliPalaX/models/video_detail_res.dart';
|
|||||||
import 'package:PiliPalaX/pages/video/detail/introduction/controller.dart';
|
import 'package:PiliPalaX/pages/video/detail/introduction/controller.dart';
|
||||||
import 'package:PiliPalaX/pages/video/detail/related/controller.dart';
|
import 'package:PiliPalaX/pages/video/detail/related/controller.dart';
|
||||||
import 'package:PiliPalaX/pages/video/detail/reply/controller.dart';
|
import 'package:PiliPalaX/pages/video/detail/reply/controller.dart';
|
||||||
|
import 'package:PiliPalaX/pages/video/detail/widgets/watch_later_list.dart';
|
||||||
import 'package:PiliPalaX/utils/extension.dart';
|
import 'package:PiliPalaX/utils/extension.dart';
|
||||||
import 'package:canvas_danmaku/models/danmaku_content_item.dart';
|
import 'package:canvas_danmaku/models/danmaku_content_item.dart';
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
@@ -346,6 +346,7 @@ class VideoDetailController extends GetxController
|
|||||||
bizId: Get.arguments['mediaId'] ?? -1,
|
bizId: Get.arguments['mediaId'] ?? -1,
|
||||||
ps: 20,
|
ps: 20,
|
||||||
oid: mediaList.last.id,
|
oid: mediaList.last.id,
|
||||||
|
otype: mediaList.last.type ?? 2,
|
||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
if (res['data'].isNotEmpty) {
|
if (res['data'].isNotEmpty) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:PiliPalaX/common/widgets/stat/danmu.dart';
|
import 'package:PiliPalaX/common/widgets/stat/danmu.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/stat/view.dart';
|
import 'package:PiliPalaX/common/widgets/stat/view.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:PiliPalaX/common/constants.dart';
|
import 'package:PiliPalaX/common/constants.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/badge.dart';
|
import 'package:PiliPalaX/common/widgets/badge.dart';
|
||||||
@@ -77,6 +78,9 @@ class _MediaListPanelState extends State<MediaListPanel> {
|
|||||||
() => ScrollablePositionedList.builder(
|
() => ScrollablePositionedList.builder(
|
||||||
itemScrollController: _scrollController,
|
itemScrollController: _scrollController,
|
||||||
itemCount: widget.mediaList.length,
|
itemCount: widget.mediaList.length,
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
bottom: MediaQuery.paddingOf(context).bottom + 25,
|
||||||
|
),
|
||||||
itemBuilder: ((context, index) {
|
itemBuilder: ((context, index) {
|
||||||
var item = widget.mediaList[index];
|
var item = widget.mediaList[index];
|
||||||
if (index == widget.mediaList.length - 1 &&
|
if (index == widget.mediaList.length - 1 &&
|
||||||
@@ -85,11 +89,15 @@ class _MediaListPanelState extends State<MediaListPanel> {
|
|||||||
}
|
}
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
if (item.type != 2) {
|
||||||
|
SmartDialog.showToast('不支持播放该类型视频');
|
||||||
|
return;
|
||||||
|
}
|
||||||
Get.back();
|
Get.back();
|
||||||
String bvid = item.bvid!;
|
String bvid = item.bvid!;
|
||||||
int? aid = item.id;
|
int? aid = item.id;
|
||||||
String cover = item.cover ?? '';
|
String cover = item.cover ?? '';
|
||||||
final int cid =
|
final int cid = item.cid ??
|
||||||
await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||||
widget.changeMediaList?.call(bvid, cid, aid, cover);
|
widget.changeMediaList?.call(bvid, cid, aid, cover);
|
||||||
},
|
},
|
||||||
Reference in New Issue
Block a user