|
|
@@ -47,6 +47,11 @@ export class Utility {
|
|
|
return PreferencesUtil.getBooleanSync('hasActiveSubscription', false);
|
|
|
}
|
|
|
|
|
|
+ static isForever(): boolean {
|
|
|
+ // 判断是不是永久会员
|
|
|
+ return PreferencesUtil.getBooleanSync('isForever', false);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 旧版客户端判断会员状态
|
|
|
* @returns
|
|
|
@@ -64,8 +69,10 @@ export class Utility {
|
|
|
let isNoble = false
|
|
|
if(StrUtil.isNotEmpty(expireDate)){
|
|
|
if(expireDate===VipPage.FOREVER_DATE){
|
|
|
+ PreferencesUtil.putSync('isForever',true)
|
|
|
isNoble = true
|
|
|
}else{
|
|
|
+ PreferencesUtil.putSync('isForever',false)
|
|
|
const currentDate = new Date();
|
|
|
const targetDate = DateUtil.getFormatDate(expireDate)
|
|
|
|
|
|
@@ -1237,11 +1244,11 @@ interface VideoNameParts {
|
|
|
|
|
|
// 提取文件名中的非数字和数字部分
|
|
|
function extractParts(name: string): VideoNameParts {
|
|
|
- // 使用正则表达式来捕获非数字部分和数字部分
|
|
|
- const match = name.match(/^(.+?)(\d+)(\.\w+)?$/);
|
|
|
+ // Adjust the regex to handle names that start with numbers
|
|
|
+ const match = name.match(/^(\D*?)(\d+)(\.\w+)?$/);
|
|
|
if (match) {
|
|
|
return {
|
|
|
- nonNumeric: match[1],
|
|
|
+ nonNumeric: match[1] || '', // Ensure nonNumeric is not undefined
|
|
|
numeric: parseInt(match[2], 10),
|
|
|
};
|
|
|
}
|
|
|
@@ -1250,6 +1257,7 @@ function extractParts(name: string): VideoNameParts {
|
|
|
numeric: 0,
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
function getInstallTime(): number | null {
|
|
|
// 从本地存储中获取安装时间
|
|
|
return PreferencesUtil.getNumberSync('installTime')
|