|
@@ -1235,14 +1235,21 @@ interface VideoNameParts {
|
|
|
numeric: number;
|
|
numeric: number;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 提取文件名中的非数字和数字部分
|
|
|
function extractParts(name: string): VideoNameParts {
|
|
function extractParts(name: string): VideoNameParts {
|
|
|
- const match = name.match(/^(\D*)(\d*)/);
|
|
|
|
|
|
|
+ // 使用正则表达式来捕获非数字部分和数字部分
|
|
|
|
|
+ const match = name.match(/^(.+?)(\d+)(\.\w+)?$/);
|
|
|
|
|
+ if (match) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ nonNumeric: match[1],
|
|
|
|
|
+ numeric: parseInt(match[2], 10),
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
return {
|
|
return {
|
|
|
- nonNumeric: match?.[1] || '',
|
|
|
|
|
- numeric: parseInt(match?.[2] || '0', 10)
|
|
|
|
|
|
|
+ nonNumeric: name,
|
|
|
|
|
+ numeric: 0,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
function getInstallTime(): number | null {
|
|
function getInstallTime(): number | null {
|
|
|
// 从本地存储中获取安装时间
|
|
// 从本地存储中获取安装时间
|
|
|
return PreferencesUtil.getNumberSync('installTime')
|
|
return PreferencesUtil.getNumberSync('installTime')
|