mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-29 20:48:40 +00:00
fix: del fav item
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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,
|
||||
)
|
||||
: {},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user