feat: account manager (#468)

* feat: account manager

* remove dep

* some fixes

* migrate accounts

* reimplement clearCookie
This commit is contained in:
My-Responsitories
2025-03-19 13:19:32 +08:00
committed by GitHub
parent 94fa0652ac
commit b15fdfa2ff
47 changed files with 1233 additions and 800 deletions

View File

@@ -6,7 +6,7 @@ import 'package:PiliPlus/utils/storage.dart';
class RcmdController extends CommonController {
late bool enableSaveLastData = GStorage.setting
.get(SettingBoxKey.enableSaveLastData, defaultValue: false);
late String defaultRcmdType = 'app';
late bool appRcmd = true;
int? lastRefreshAt;
late bool savedRcmdTip = GStorage.savedRcmdTip;
@@ -14,8 +14,7 @@ class RcmdController extends CommonController {
@override
void onInit() {
super.onInit();
defaultRcmdType = GStorage.setting
.get(SettingBoxKey.defaultRcmdType, defaultValue: 'app');
appRcmd = GStorage.appRcmd;
currentPage = 0;
queryData();
@@ -23,15 +22,9 @@ class RcmdController extends CommonController {
@override
Future<LoadingState> customGetData() {
return defaultRcmdType == 'app' || defaultRcmdType == 'notLogin'
? VideoHttp.rcmdVideoListApp(
loginStatus: defaultRcmdType != 'notLogin',
freshIdx: currentPage,
)
: VideoHttp.rcmdVideoList(
freshIdx: currentPage,
ps: 20,
);
return appRcmd
? VideoHttp.rcmdVideoListApp(freshIdx: currentPage)
: VideoHttp.rcmdVideoList(freshIdx: currentPage, ps: 20);
}
@override