Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-27 11:50:40 +08:00
parent 916931dd11
commit 6ca7efe8d1
15 changed files with 29 additions and 51 deletions

View File

@@ -7,13 +7,13 @@ import 'package:PiliPlus/utils/accounts.dart';
class BlackHttp {
static Future<LoadingState<BlackListData>> blackList({
required int pn,
int? ps,
int ps = 50,
}) async {
var res = await Request().get(
Api.blackLst,
queryParameters: {
'pn': pn,
'ps': ps ?? 50,
'ps': ps,
're_version': 0,
'jsonp': 'jsonp',
'csrf': Accounts.main.csrf,

View File

@@ -7,7 +7,7 @@ class FanHttp {
static Future<LoadingState<FansData>> fans({
int? vmid,
int? pn,
int? ps,
int ps = 20,
String? orderType,
}) async {
var res = await Request().get(

View File

@@ -7,7 +7,7 @@ class FollowHttp {
static Future<LoadingState<FollowData>> followings({
int? vmid,
int? pn,
int? ps,
int ps = 50,
String orderType = '',
}) async {
var res = await Request().get(
@@ -32,7 +32,7 @@ class FollowHttp {
static Future<LoadingState<FollowData>> followingsNew({
int? vmid,
int? pn,
int? ps,
int ps = 20,
String orderType = '', // ''=>最近关注,'attention'=>最常访问
}) async {
var res = await Request().get(

View File

@@ -280,16 +280,6 @@ class Request {
}
}
/*
* 取消请求
*
* 同一个cancel token 可以用于多个请求当一个cancel token取消时所有使用该cancel token的请求都会被取消。
* 所以参数可选
*/
void cancelRequests(CancelToken token) {
token.cancel("cancelled");
}
static String responseDecoder(
List<int> responseBytes,
RequestOptions options,

View File

@@ -526,12 +526,12 @@ class MemberHttp {
}
// 获取某分组下的up
static Future<LoadingState<FollowData>> followUpGroup(
static Future<LoadingState<FollowData>> followUpGroup({
int? mid,
int? tagid,
int? pn,
int? ps,
) async {
int ps = 20,
}) async {
var res = await Request().get(
Api.followUpGroup,
queryParameters: {

View File

@@ -816,7 +816,7 @@ class VideoHttp {
}
}
static Future vttSubtitles(String subtitleUrl) async {
static Future<String?> vttSubtitles(String subtitleUrl) async {
String subtitleTimecode(num seconds) {
int h = seconds ~/ 3600;
seconds %= 3600;
@@ -842,8 +842,8 @@ class VideoHttp {
var res = await Request().get("https:$subtitleUrl");
if (res.data?['body'] is List) {
return await compute(processList, res.data['body'] as List);
if (res.data?['body'] case List list) {
return compute<List, String>(processList, list);
}
return null;
}