mod: 评论链接跳转视频

This commit is contained in:
guozhigq
2023-08-27 14:22:12 +08:00
parent e8cd0d5330
commit a1900c7362
3 changed files with 39 additions and 9 deletions

View File

@ -56,14 +56,20 @@ class SearchPanelController extends GetxController {
// 匹配输入内容如果是AV、BV号且有结果 直接跳转详情页
Map matchRes = IdUtils.matchAvorBv(input: keyword);
List matchKeys = matchRes.keys.toList();
if (matchKeys.isNotEmpty && searchType == SearchType.video) {
String bvid = resultList.first.bvid;
int aid = resultList.first.aid;
String bvid = resultList.first.bvid;
// keyword 可能输入纯数字
int aid = resultList.first.aid;
if (matchKeys.isNotEmpty && searchType == SearchType.video ||
aid.toString() == keyword) {
String heroTag = Utils.makeHeroTag(bvid);
int cid = await SearchHttp.ab2c(aid: aid, bvid: bvid);
if (matchKeys.first == 'BV' && matchRes[matchKeys.first] == bvid ||
matchKeys.first == 'AV' && matchRes[matchKeys.first] == aid) {
if (matchKeys.isNotEmpty &&
matchKeys.first == 'BV' &&
matchRes[matchKeys.first] == bvid ||
matchKeys.isNotEmpty &&
matchKeys.first == 'AV' &&
matchRes[matchKeys.first] == aid ||
aid.toString() == keyword) {
Get.toNamed(
'/video?bvid=$bvid&cid=$cid',
arguments: {'videoItem': resultList.first, 'heroTag': heroTag},