mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-19 15:44:24 +08:00
precheck video dimension
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||
import 'package:PiliPlus/models/common/stat_type.dart';
|
||||
import 'package:PiliPlus/models_new/music/bgm_recommend_list.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
|
||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
@@ -33,14 +34,22 @@ class MusicVideoCardH extends StatelessWidget {
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
int? cid =
|
||||
videoItem.cid ?? await SearchHttp.ab2c(bvid: videoItem.bvid);
|
||||
int? cid = videoItem.cid;
|
||||
Dimension? dimension;
|
||||
if (cid == null) {
|
||||
if (await SearchHttp.ab2cWithDimension(bvid: videoItem.bvid)
|
||||
case final res?) {
|
||||
cid = res.cid;
|
||||
dimension = res.dimension;
|
||||
}
|
||||
}
|
||||
if (cid != null) {
|
||||
PageUtils.toVideoPage(
|
||||
bvid: videoItem.bvid,
|
||||
cid: cid,
|
||||
cover: videoItem.cover,
|
||||
title: videoItem.title,
|
||||
dimension: dimension,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user