🐛 修复(substore): 避免特征尾号和 HY2 误判

This commit is contained in:
Orion
2026-06-03 16:09:15 +08:00
parent 30e68ff3e9
commit f9e0d1146c
8 changed files with 27 additions and 10 deletions
+9 -2
View File
@@ -5,7 +5,7 @@
* - 基于归一化后的完整名称做精准去重
*/
// noinspection JSUnusedGlobalSymbols
const COMMON_SCRIPT_URL = 'https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-5';
const COMMON_SCRIPT_URL = 'https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-6';
const hasCurrentRenameUtils = utils => Boolean(
utils && typeof utils.normalizeLeadingMojibakeFlag === 'function'
);
@@ -674,6 +674,11 @@ async function operator(proxies) {
const normalizeRegionSequence = name => utils.normalizeRegionSequence(name, { allowCityCode: true });
const stripTrailingFeatureSequence = name => String(name)
.replace(/^([A-Z]{2}(?:\s+[A-Z]{3})?)\s+([A-Z][A-Z0-9.]{1,15})\s+\d{1,2}$/i, '$1 $2')
.replace(/\s{2,}/g, ' ')
.trim();
const regionSequenceOf = name => {
const sequenceMatch = name.match(/^((?:[\u{1F1E6}-\u{1F1FF}]{2}|🏴‍☠️)\s*)?([A-Z]{2}(?:\s+[A-Z]{3})?)(?:\s+(\d{2}))?(\s.*)?$/u);
if (!sequenceMatch) return null;
@@ -780,7 +785,9 @@ async function operator(proxies) {
core = joinAlias(flagRegionCode, core);
}
core = normalizeRegionSequence(normalizeHyphenatedRegionFeatures(moveMultiplierToEnd(simplifyCoreName(core))))
core = stripTrailingFeatureSequence(
normalizeRegionSequence(normalizeHyphenatedRegionFeatures(moveMultiplierToEnd(simplifyCoreName(core))))
)
.replace(/^([A-Z]{2}(?:\s+[A-Z]{3})?\s+\d{2}\s+(?:标准|高级))\s+1(?=$|\s)/i, '$1');
const coreRegionCode = leadingCodeOf(core);