mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
@@ -32,18 +32,18 @@ mixin BaseFavController
|
||||
void onViewFav(FavDetailItemModel item, int? index);
|
||||
|
||||
Future<void> onCancelFav(int index, int id, int type) async {
|
||||
final result = await FavHttp.favVideo(
|
||||
final res = await FavHttp.favVideo(
|
||||
resources: '$id:$type',
|
||||
delIds: mediaId.toString(),
|
||||
);
|
||||
if (result.isSuccess) {
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
..refresh();
|
||||
updateCount?.call(1);
|
||||
SmartDialog.showToast('取消收藏');
|
||||
} else {
|
||||
result.toast();
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,18 +55,18 @@ mixin BaseFavController
|
||||
title: '提示',
|
||||
onConfirm: () async {
|
||||
final removeList = allChecked.toSet();
|
||||
final result = await FavHttp.favVideo(
|
||||
final res = await FavHttp.favVideo(
|
||||
resources: removeList
|
||||
.map((item) => '${item.id}:${item.type}')
|
||||
.join(','),
|
||||
delIds: mediaId.toString(),
|
||||
);
|
||||
if (result.isSuccess) {
|
||||
if (res.isSuccess) {
|
||||
updateCount?.call(removeList.length);
|
||||
afterDelete(removeList);
|
||||
SmartDialog.showToast('取消收藏');
|
||||
} else {
|
||||
result.toast();
|
||||
res.toast();
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -199,13 +199,14 @@ class FavDetailController
|
||||
}
|
||||
|
||||
void onSort() {
|
||||
if (loadingState.value.isSuccess &&
|
||||
loadingState.value.data?.isNotEmpty == true) {
|
||||
if (folderInfo.value.mediaCount > 1000) {
|
||||
SmartDialog.showToast('内容太多啦!超过1000不支持排序');
|
||||
return;
|
||||
if (loadingState.value case Success(:final response)) {
|
||||
if (response != null && response.isNotEmpty) {
|
||||
if (folderInfo.value.mediaCount > 1000) {
|
||||
SmartDialog.showToast('内容太多啦!超过1000不支持排序');
|
||||
return;
|
||||
}
|
||||
Get.to(FavSortPage(favDetailController: this));
|
||||
}
|
||||
Get.to(FavSortPage(favDetailController: this));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user