Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2026-01-02 12:05:31 +08:00
parent 80e007bac6
commit 041af37bb0
67 changed files with 775 additions and 838 deletions

View File

@@ -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));
}
}