mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: sponsor block
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:PiliPalaX/models/model_owner.dart';
|
||||
import 'package:PiliPalaX/models/search/hot.dart';
|
||||
import 'package:PiliPalaX/models/user/info.dart';
|
||||
import 'global_data.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class GStorage {
|
||||
static late final Box<dynamic> userInfo;
|
||||
@@ -49,6 +50,16 @@ class GStorage {
|
||||
static double get blockLimit =>
|
||||
setting.get(SettingBoxKey.blockLimit, defaultValue: 0.0);
|
||||
|
||||
static String get blockUserID {
|
||||
String blockUserID =
|
||||
setting.get(SettingBoxKey.blockUserID, defaultValue: '');
|
||||
if (blockUserID.isEmpty) {
|
||||
blockUserID = Uuid().v4().replaceAll('-', '');
|
||||
setting.put(SettingBoxKey.blockUserID, blockUserID);
|
||||
}
|
||||
return blockUserID;
|
||||
}
|
||||
|
||||
static ThemeMode get themeMode {
|
||||
switch (setting.get(SettingBoxKey.themeMode,
|
||||
defaultValue: ThemeType.system.code)) {
|
||||
@@ -225,6 +236,7 @@ class SettingBoxKey {
|
||||
blockSettings = 'blockSettings',
|
||||
blockLimit = 'blockLimit',
|
||||
blockColor = 'blockColor',
|
||||
blockUserID = 'blockUserID',
|
||||
|
||||
// 弹幕相关设置 权重(云屏蔽) 屏蔽类型 显示区域 透明度 字体大小 弹幕时间 描边粗细 字体粗细
|
||||
danmakuWeight = 'danmakuWeight',
|
||||
|
||||
@@ -602,6 +602,22 @@ class Utils {
|
||||
return v.toString() + random.nextInt(9999).toString();
|
||||
}
|
||||
|
||||
static String formatDuration(int seconds) {
|
||||
int hours = seconds ~/ 3600;
|
||||
int minutes = (seconds % 3600) ~/ 60;
|
||||
int remainingSeconds = seconds % 60;
|
||||
|
||||
String minutesStr = minutes.toString().padLeft(2, '0');
|
||||
String secondsStr = remainingSeconds.toString().padLeft(2, '0');
|
||||
|
||||
if (hours > 0) {
|
||||
String hoursStr = hours.toString().padLeft(2, '0');
|
||||
return "$hoursStr:$minutesStr:$secondsStr";
|
||||
} else {
|
||||
return "$minutesStr:$secondsStr";
|
||||
}
|
||||
}
|
||||
|
||||
static int duration(String duration) {
|
||||
List timeList = duration.split(':');
|
||||
int len = timeList.length;
|
||||
|
||||
Reference in New Issue
Block a user