mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
tweaks (#1738)
* feat: edit dm filter * opt: browser * feat: sb userInfo * mod: tvPlayUrl
This commit is contained in:
committed by
GitHub
parent
9754b061dd
commit
bca5b0419c
@@ -1,26 +1,21 @@
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/user/danmaku_block.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
class DanmakuFilterHttp {
|
||||
static Future danmakuFilter() async {
|
||||
static Future<LoadingState<DanmakuBlockDataModel>> danmakuFilter() async {
|
||||
var res = await Request().get(Api.danmakuFilter);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': DanmakuBlockDataModel.fromJson(res.data['data']),
|
||||
};
|
||||
return Success(DanmakuBlockDataModel.fromJson(res.data['data']));
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future danmakuFilterDel({required int ids}) async {
|
||||
static Future<LoadingState<Null>> danmakuFilterDel({required int ids}) async {
|
||||
var res = await Request().post(
|
||||
Api.danmakuFilterDel,
|
||||
data: {
|
||||
@@ -30,16 +25,13 @@ class DanmakuFilterHttp {
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true};
|
||||
return const Success(null);
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future danmakuFilterAdd({
|
||||
static Future<LoadingState<SimpleRule>> danmakuFilterAdd({
|
||||
required String filter,
|
||||
required int type,
|
||||
}) async {
|
||||
@@ -53,15 +45,9 @@ class DanmakuFilterHttp {
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': SimpleRule.fromJson(res.data['data']),
|
||||
};
|
||||
return Success(SimpleRule.fromJson(res.data['data']));
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1068,11 +1068,10 @@ class VideoHttp {
|
||||
required int playurlType, // ugc 1, pgc 2
|
||||
int? qn,
|
||||
}) async {
|
||||
final accessKey = Accounts.accountMode[AccountType.video.index].accessKey;
|
||||
final accessKey = Accounts.get(AccountType.video).accessKey;
|
||||
final params = {
|
||||
'access_key': ?accessKey,
|
||||
'actionKey': 'appkey',
|
||||
'appkey': Constants.appKey,
|
||||
'cid': cid,
|
||||
'fourk': 1,
|
||||
'is_proj': 1,
|
||||
|
||||
Reference in New Issue
Block a user