mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: view pgc
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -79,18 +79,8 @@ class VideoCardH extends StatelessWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (videoItem is HotVideoItemModel &&
|
if (videoItem is HotVideoItemModel &&
|
||||||
// videoItem.pgcLabel?.isNotEmpty == true &&
|
|
||||||
videoItem.redirectUrl?.isNotEmpty == true) {
|
videoItem.redirectUrl?.isNotEmpty == true) {
|
||||||
String? id = RegExp(r'(ep|ss)\d+')
|
if (Utils.viewPgcFromUri(videoItem.redirectUrl!)) {
|
||||||
.firstMatch(videoItem.redirectUrl)
|
|
||||||
?.group(0);
|
|
||||||
if (id != null) {
|
|
||||||
bool isSeason = id.startsWith('ss');
|
|
||||||
id = id.substring(2);
|
|
||||||
Utils.viewBangumi(
|
|
||||||
seasonId: isSeason ? id : null,
|
|
||||||
epId: isSeason ? null : id,
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ class VideoCardHMemberVideo extends StatelessWidget {
|
|||||||
onTap!();
|
onTap!();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (videoItem.isPgc == true && videoItem.uri?.isNotEmpty == true) {
|
||||||
|
if (Utils.viewPgcFromUri(videoItem.uri!)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/video?bvid=$bvid&cid=${videoItem.firstCid}',
|
'/video?bvid=$bvid&cid=${videoItem.firstCid}',
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ class VideoCardV extends StatelessWidget {
|
|||||||
String goto = videoItem.goto;
|
String goto = videoItem.goto;
|
||||||
switch (goto) {
|
switch (goto) {
|
||||||
case 'bangumi':
|
case 'bangumi':
|
||||||
if (videoItem.bangumiBadge == '电影') {
|
// if (videoItem.bangumiBadge == '电影') {
|
||||||
SmartDialog.showToast('暂不支持电影观看');
|
// SmartDialog.showToast('暂不支持电影观看');
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
Utils.viewBangumi(epId: videoItem.param);
|
Utils.viewBangumi(epId: videoItem.param);
|
||||||
// SmartDialog.showLoading(msg: '资源获取中');
|
// SmartDialog.showLoading(msg: '资源获取中');
|
||||||
// var result = await SearchHttp.bangumiInfo(seasonId: null, epId: epId);
|
// var result = await SearchHttp.bangumiInfo(seasonId: null, epId: epId);
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ class VideoCardVMemberHome extends StatelessWidget {
|
|||||||
void onPushDetail(heroTag) async {
|
void onPushDetail(heroTag) async {
|
||||||
String goto = videoItem.goto ?? '';
|
String goto = videoItem.goto ?? '';
|
||||||
switch (goto) {
|
switch (goto) {
|
||||||
// case 'bangumi':
|
case 'bangumi':
|
||||||
// if (videoItem.bangumiBadge == '电影') {
|
// if (videoItem.bangumiBadge == '电影') {
|
||||||
// SmartDialog.showToast('暂不支持电影观看');
|
// SmartDialog.showToast('暂不支持电影观看');
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// int epId = videoItem.param;
|
// int epId = videoItem.param;
|
||||||
// Utils.viewBangumi(epId: epId);
|
Utils.viewBangumi(epId: videoItem.param);
|
||||||
|
|
||||||
// SmartDialog.showLoading(msg: '资源获取中');
|
// SmartDialog.showLoading(msg: '资源获取中');
|
||||||
// var result = await SearchHttp.bangumiInfo(seasonId: null, epId: epId);
|
// var result = await SearchHttp.bangumiInfo(seasonId: null, epId: epId);
|
||||||
@@ -63,6 +63,11 @@ class VideoCardVMemberHome extends StatelessWidget {
|
|||||||
// }
|
// }
|
||||||
// break;
|
// break;
|
||||||
case 'av':
|
case 'av':
|
||||||
|
if (videoItem.isPgc == true && videoItem.uri?.isNotEmpty == true) {
|
||||||
|
if (Utils.viewPgcFromUri(videoItem.uri!)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
String bvid = videoItem.bvid ?? '';
|
String bvid = videoItem.bvid ?? '';
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/video?bvid=$bvid&cid=${videoItem.firstCid}',
|
'/video?bvid=$bvid&cid=${videoItem.firstCid}',
|
||||||
|
|||||||
@@ -39,6 +39,20 @@ class Utils {
|
|||||||
|
|
||||||
static const channel = MethodChannel("PiliPlus");
|
static const channel = MethodChannel("PiliPlus");
|
||||||
|
|
||||||
|
static bool viewPgcFromUri(String uri) {
|
||||||
|
String? id = RegExp(r'(ep|ss)\d+').firstMatch(uri)?.group(0);
|
||||||
|
if (id != null) {
|
||||||
|
bool isSeason = id.startsWith('ss');
|
||||||
|
id = id.substring(2);
|
||||||
|
Utils.viewBangumi(
|
||||||
|
seasonId: isSeason ? id : null,
|
||||||
|
epId: isSeason ? null : id,
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static void showCopyTextDialog(text) {
|
static void showCopyTextDialog(text) {
|
||||||
Get.dialog(
|
Get.dialog(
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
|
|||||||
Reference in New Issue
Block a user