mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: bangumi
This commit is contained in:
@@ -304,7 +304,7 @@ class VideoHttp {
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
} else {
|
||||
return {'status': false, 'data': []};
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class BangumiIntroController extends CommonController {
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
userLogin = userInfo != null;
|
||||
|
||||
if (userLogin) {
|
||||
if (userLogin && epId != null) {
|
||||
// // 获取点赞状态
|
||||
// queryHasLikeVideo();
|
||||
// // 获取投币状态
|
||||
@@ -120,9 +120,13 @@ class BangumiIntroController extends CommonController {
|
||||
// 获取点赞/投币/收藏状态
|
||||
Future queryBangumiLikeCoinFav() async {
|
||||
var result = await VideoHttp.bangumiLikeCoinFav(epId: epId);
|
||||
if (result['status']) {
|
||||
hasLike.value = result["data"]['like'] == 1;
|
||||
hasCoin.value = result["data"]['coin_number'] != 0;
|
||||
hasFav.value = result["data"]['favorite'] == 1;
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取点赞状态
|
||||
|
||||
@@ -192,24 +192,23 @@ class DynamicsController extends GetxController
|
||||
var res = await SearchHttp.bangumiInfo(epId: pgc.epid);
|
||||
SmartDialog.dismiss();
|
||||
if (res['status']) {
|
||||
EpisodeItem episode = res['data'].episodes.first;
|
||||
int? epId = res['data'].userStatus?.progress?.lastEpId;
|
||||
if (epId == null) {
|
||||
epId = episode.epId;
|
||||
} else {
|
||||
for (var item in res['data'].episodes) {
|
||||
if (item.epId == epId) {
|
||||
episode = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String bvid = episode.bvid!;
|
||||
int cid = episode.cid!;
|
||||
String pic = episode.cover!;
|
||||
String heroTag = Utils.makeHeroTag(cid);
|
||||
// dynamic episode -> progress episode -> first episode
|
||||
EpisodeItem episode = (res['data'].episodes as List)
|
||||
.firstWhereOrNull(
|
||||
(item) => item.epId == pgc.epid,
|
||||
) ??
|
||||
(res['data'].episodes as List).firstWhereOrNull(
|
||||
(item) =>
|
||||
item.epId == res['data'].userStatus?.progress?.lastEpId,
|
||||
) ??
|
||||
res['data'].episodes.first;
|
||||
dynamic epId = episode.epId;
|
||||
dynamic bvid = episode.bvid;
|
||||
dynamic cid = episode.cid;
|
||||
dynamic pic = episode.cover;
|
||||
dynamic heroTag = Utils.makeHeroTag(cid);
|
||||
toDupNamed(
|
||||
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epid=$epId',
|
||||
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epId=$epId',
|
||||
arguments: {
|
||||
'pic': pic,
|
||||
'heroTag': heroTag,
|
||||
|
||||
@@ -123,7 +123,7 @@ class HistoryItem extends StatelessWidget {
|
||||
String pic = episode.cover!;
|
||||
String heroTag = Utils.makeHeroTag(cid);
|
||||
Get.toNamed(
|
||||
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epid=${episode.epId}',
|
||||
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epId=${episode.epId}',
|
||||
arguments: {
|
||||
'pic': pic,
|
||||
'heroTag': heroTag,
|
||||
|
||||
@@ -165,7 +165,7 @@ Widget searchBangumiPanel(BuildContext context, ctr, loadingState) {
|
||||
String heroTag =
|
||||
Utils.makeHeroTag(cid);
|
||||
Get.toNamed(
|
||||
'/video?bvid=$bvid&cid=$cid&seasonId=${i.seasonId}&epid=$epId',
|
||||
'/video?bvid=$bvid&cid=$cid&seasonId=${i.seasonId}&epId=$epId',
|
||||
arguments: {
|
||||
'pic': pic,
|
||||
'heroTag': heroTag,
|
||||
|
||||
Reference in New Issue
Block a user