mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
opt get season status
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -972,4 +972,6 @@ class Api {
|
|||||||
static const String followedUp = '/x/relation/followings/followed_upper';
|
static const String followedUp = '/x/relation/followings/followed_upper';
|
||||||
|
|
||||||
static const String sameFollowing = '/x/relation/same/followings';
|
static const String sameFollowing = '/x/relation/same/followings';
|
||||||
|
|
||||||
|
static const String seasonStatus = '/pgc/view/web/season/user/status';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,4 +242,18 @@ class PgcHttp {
|
|||||||
return {'status': false, 'msg': res.data['message']};
|
return {'status': false, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future seasonStatus(dynamic seasonId) async {
|
||||||
|
var res = await Request().get(
|
||||||
|
Api.seasonStatus,
|
||||||
|
queryParameters: {
|
||||||
|
'season_id': seasonId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (res.data['code'] == 0) {
|
||||||
|
return {'status': true, 'data': res.data['result']};
|
||||||
|
} else {
|
||||||
|
return {'status': false, 'msg': res.data['message']};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math' show max;
|
import 'dart:math' show max;
|
||||||
|
|
||||||
import 'package:PiliPlus/grpc/bilibili/app/viewunite/pgcanymodel.pb.dart'
|
|
||||||
show ViewPgcAny;
|
|
||||||
import 'package:PiliPlus/grpc/view.dart';
|
|
||||||
import 'package:PiliPlus/http/constants.dart';
|
import 'package:PiliPlus/http/constants.dart';
|
||||||
import 'package:PiliPlus/http/fav.dart';
|
import 'package:PiliPlus/http/fav.dart';
|
||||||
|
import 'package:PiliPlus/http/pgc.dart';
|
||||||
import 'package:PiliPlus/http/search.dart';
|
import 'package:PiliPlus/http/search.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/common/video/source_type.dart';
|
import 'package:PiliPlus/models/common/video/source_type.dart';
|
||||||
@@ -448,7 +446,7 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void queryIsFollowed() {
|
Future<void> queryIsFollowed() async {
|
||||||
// try {
|
// try {
|
||||||
// var result = await Request().get(
|
// var result = await Request().get(
|
||||||
// 'https://www.bilibili.com/bangumi/play/ss$seasonId',
|
// 'https://www.bilibili.com/bangumi/play/ss$seasonId',
|
||||||
@@ -464,14 +462,22 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
// scriptContent['props']['pageProps']['followState']['followStatus'];
|
// scriptContent['props']['pageProps']['followState']['followStatus'];
|
||||||
// }
|
// }
|
||||||
// } catch (_) {}
|
// } catch (_) {}
|
||||||
ViewGrpc.view(bvid: bvid).then((res) {
|
|
||||||
if (res.isSuccess) {
|
// ViewGrpc.view(bvid: bvid).then((res) {
|
||||||
ViewPgcAny view = ViewPgcAny.fromBuffer(res.data.supplement.value);
|
// if (res.isSuccess) {
|
||||||
var userStatus = view.ogvData.userStatus;
|
// ViewPgcAny view = ViewPgcAny.fromBuffer(res.data.supplement.value);
|
||||||
isFollowed.value = userStatus.follow == 1;
|
// var userStatus = view.ogvData.userStatus;
|
||||||
followStatus.value = userStatus.followStatus;
|
// isFollowed.value = userStatus.follow == 1;
|
||||||
}
|
// followStatus.value = userStatus.followStatus;
|
||||||
});
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
final res = await PgcHttp.seasonStatus(seasonId);
|
||||||
|
if (res['status']) {
|
||||||
|
final data = res['data'];
|
||||||
|
isFollowed.value = data['follow'] == 1;
|
||||||
|
followStatus.value = data['follow_status'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -785,7 +785,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: "version_4.7.2"
|
ref: "version_4.7.2"
|
||||||
resolved-ref: "92be28f3279717fc7f63969d144b97e16fff1e38"
|
resolved-ref: "579a8978a922e6c57cebd001320f78674e040418"
|
||||||
url: "https://github.com/bggRGjQaUbCoE/getx.git"
|
url: "https://github.com/bggRGjQaUbCoE/getx.git"
|
||||||
source: git
|
source: git
|
||||||
version: "4.7.2"
|
version: "4.7.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user