mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: later page: multi select
feat: fav detail page: multi select opt: reply item opt: load more Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -92,7 +92,9 @@ class Api {
|
||||
// https://api.bilibili.com/x/v3/fav/resource/deal
|
||||
static const String favVideo = '/x/v3/fav/resource/deal';
|
||||
|
||||
static const String favBangumi = '/x/v3/fav/resource/batch-deal';
|
||||
// static const String favBangumi = '/x/v3/fav/resource/batch-deal';
|
||||
|
||||
static const String delFav = '/x/v3/fav/resource/batch-del';
|
||||
|
||||
// 判断视频是否被收藏(双端)GET
|
||||
/// aid
|
||||
|
||||
@@ -158,8 +158,10 @@ class UserHttp {
|
||||
for (var i in res.data['data']['list']) {
|
||||
list.add(HotVideoItemModel.fromJson(i));
|
||||
}
|
||||
return LoadingState.success(
|
||||
{'list': list, 'count': res.data['data']['count']});
|
||||
return LoadingState.success({
|
||||
'list': list,
|
||||
'count': res.data['data']['count'],
|
||||
});
|
||||
} else {
|
||||
return LoadingState.error(res.data['message']);
|
||||
}
|
||||
@@ -239,16 +241,18 @@ class UserHttp {
|
||||
}
|
||||
|
||||
// 移除已观看
|
||||
static Future toViewDel({int? aid}) async {
|
||||
static Future toViewDel({
|
||||
List? aids,
|
||||
}) async {
|
||||
final Map<String, dynamic> params = {
|
||||
'jsonp': 'jsonp',
|
||||
'csrf': await Request.getCsrf(),
|
||||
if (aids != null) 'aid': aids.join(',') else 'viewed': true
|
||||
};
|
||||
|
||||
params[aid != null ? 'aid' : 'viewed'] = aid ?? true;
|
||||
var res = await Request().post(
|
||||
dynamic res = await Request().post(
|
||||
Api.toViewDel,
|
||||
queryParameters: params,
|
||||
data: params,
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'msg': 'yeah!成功移除'};
|
||||
|
||||
@@ -563,45 +563,19 @@ class VideoHttp {
|
||||
}
|
||||
|
||||
// (取消)收藏
|
||||
static Future favVideo({
|
||||
required int aid,
|
||||
String? addIds,
|
||||
String? delIds,
|
||||
int? type,
|
||||
}) async {
|
||||
var res = await Request().post(Api.favVideo, queryParameters: {
|
||||
'rid': aid,
|
||||
'type': type ?? 2,
|
||||
'add_media_ids': addIds ?? '',
|
||||
'del_media_ids': delIds ?? '',
|
||||
'csrf': await Request.getCsrf(),
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
} else {
|
||||
return {'status': false, 'data': [], 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
// (取消)收藏 bangumi
|
||||
static Future favBangumi({
|
||||
required dynamic epId,
|
||||
String? addIds,
|
||||
static Future delFav({
|
||||
List? ids,
|
||||
String? delIds,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.favBangumi,
|
||||
Api.delFav,
|
||||
data: {
|
||||
'resources': '$epId:24',
|
||||
'add_media_ids': addIds ?? '',
|
||||
'del_media_ids': delIds ?? '',
|
||||
'resources': ids?.join(','),
|
||||
'media_id': delIds,
|
||||
'platform': 'web',
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
options: Options(
|
||||
headers: {
|
||||
'Content-Type': Headers.formUrlEncodedContentType,
|
||||
},
|
||||
),
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
@@ -610,6 +584,58 @@ class VideoHttp {
|
||||
}
|
||||
}
|
||||
|
||||
// (取消)收藏
|
||||
static Future favVideo({
|
||||
int? aid,
|
||||
String? addIds,
|
||||
String? delIds,
|
||||
int? type,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.favVideo,
|
||||
data: {
|
||||
'rid': aid,
|
||||
'type': type ?? 2,
|
||||
'add_media_ids': addIds ?? '',
|
||||
'del_media_ids': delIds ?? '',
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
// (取消)收藏 bangumi
|
||||
// static Future favBangumi({
|
||||
// required dynamic epId,
|
||||
// String? addIds,
|
||||
// String? delIds,
|
||||
// }) async {
|
||||
// var res = await Request().post(
|
||||
// Api.favBangumi,
|
||||
// data: {
|
||||
// 'resources': '$epId:24',
|
||||
// 'add_media_ids': addIds ?? '',
|
||||
// 'del_media_ids': delIds ?? '',
|
||||
// 'csrf': await Request.getCsrf(),
|
||||
// },
|
||||
// options: Options(
|
||||
// headers: {
|
||||
// 'Content-Type': Headers.formUrlEncodedContentType,
|
||||
// },
|
||||
// ),
|
||||
// );
|
||||
// if (res.data['code'] == 0) {
|
||||
// return {'status': true, 'data': res.data['data']};
|
||||
// } else {
|
||||
// return {'status': false, 'msg': res.data['message']};
|
||||
// }
|
||||
// }
|
||||
|
||||
// 查看视频被收藏在哪个文件夹
|
||||
static Future videoInFolder({
|
||||
dynamic mid,
|
||||
|
||||
Reference in New Issue
Block a user