mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 17:46:24 +08:00
mod: quick fav bangumi
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -62,6 +62,9 @@ class BangumiIntroController extends CommonController {
|
||||
List delMediaIdsNew = [];
|
||||
dynamic userInfo;
|
||||
|
||||
late final enableQuickFav =
|
||||
GStorage.setting.get(SettingBoxKey.enableQuickFav, defaultValue: false);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -281,7 +284,29 @@ class BangumiIntroController extends CommonController {
|
||||
}
|
||||
|
||||
// (取消)收藏 bangumi
|
||||
Future actionFavVideo() async {
|
||||
Future actionFavVideo({type = 'choose'}) async {
|
||||
// 收藏至默认文件夹
|
||||
if (type == 'default') {
|
||||
SmartDialog.showLoading(msg: '请求中');
|
||||
await queryVideoInFolder();
|
||||
int defaultFolderId = favFolderData.value.list!.first.id!;
|
||||
int favStatus = favFolderData.value.list!.first.favState!;
|
||||
var result = await VideoHttp.favVideo(
|
||||
aid: epId,
|
||||
type: 24,
|
||||
addIds: favStatus == 0 ? '$defaultFolderId' : '',
|
||||
delIds: favStatus == 1 ? '$defaultFolderId' : '',
|
||||
);
|
||||
SmartDialog.dismiss();
|
||||
if (result['status']) {
|
||||
// 重新获取收藏状态
|
||||
await queryBangumiLikeCoinFav();
|
||||
SmartDialog.showToast('✅ 快速收藏/取消收藏成功');
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
for (var i in favFolderData.value.list!.toList()) {
|
||||
if (i.favState == 1) {
|
||||
|
||||
Reference in New Issue
Block a user