mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: del fav item
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -61,11 +61,12 @@ class FavDetailController extends CommonController {
|
||||
return true;
|
||||
}
|
||||
|
||||
onCancelFav(int id) async {
|
||||
onCancelFav(int id, int type) async {
|
||||
var result = await VideoHttp.favVideo(
|
||||
aid: id,
|
||||
addIds: '',
|
||||
delIds: mediaId.toString(),
|
||||
type: type,
|
||||
);
|
||||
if (result['status']) {
|
||||
List dataList = (loadingState.value as Success).response;
|
||||
|
||||
@@ -302,8 +302,10 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
||||
}
|
||||
return FavVideoCardH(
|
||||
videoItem: loadingState.response[index],
|
||||
callFn: () => _favDetailController
|
||||
.onCancelFav(loadingState.response[index].id),
|
||||
callFn: () => _favDetailController.onCancelFav(
|
||||
loadingState.response[index].id,
|
||||
loadingState.response[index].type,
|
||||
),
|
||||
);
|
||||
},
|
||||
childCount: loadingState.response.length + 1,
|
||||
|
||||
@@ -84,9 +84,13 @@ class FavSearchController extends CommonController {
|
||||
return true;
|
||||
}
|
||||
|
||||
onCancelFav(int id) async {
|
||||
onCancelFav(int id, int type) async {
|
||||
var result = await VideoHttp.favVideo(
|
||||
aid: id, addIds: '', delIds: mediaId.toString());
|
||||
aid: id,
|
||||
addIds: '',
|
||||
delIds: mediaId.toString(),
|
||||
type: type,
|
||||
);
|
||||
if (result['status']) {
|
||||
List dataList = (loadingState.value as Success).response;
|
||||
dataList = dataList.where((item) => item.id != id).toList();
|
||||
|
||||
@@ -104,8 +104,10 @@ class _FavSearchPageState extends State<FavSearchPage> {
|
||||
videoItem: loadingState.response[index],
|
||||
searchType: _favSearchCtr.type,
|
||||
callFn: () => _favSearchCtr.type != 1
|
||||
? _favSearchCtr
|
||||
.onCancelFav(loadingState.response[index].id!)
|
||||
? _favSearchCtr.onCancelFav(
|
||||
loadingState.response[index].id!,
|
||||
loadingState.response[index].type,
|
||||
)
|
||||
: {},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -392,9 +392,10 @@ class VideoIntroController extends GetxController
|
||||
}
|
||||
SmartDialog.showLoading(msg: '请求中');
|
||||
var result = await VideoHttp.favVideo(
|
||||
aid: IdUtils.bv2av(bvid),
|
||||
addIds: addMediaIdsNew.join(','),
|
||||
delIds: delMediaIdsNew.join(','));
|
||||
aid: IdUtils.bv2av(bvid),
|
||||
addIds: addMediaIdsNew.join(','),
|
||||
delIds: delMediaIdsNew.join(','),
|
||||
);
|
||||
SmartDialog.dismiss();
|
||||
if (result['status']) {
|
||||
addMediaIdsNew = [];
|
||||
|
||||
Reference in New Issue
Block a user