fix(data): 修复权威时刻表与NBT显示粒度不一致导致终点站漏播(「千叶」聚合名 vs「千叶CB-03 6」具体站台)
- tryCorrectUpcomingEntryWithCurrentTrain: 校正逻辑从『仅无效乱码才覆盖』改为『同站fuzzy匹配且字符串不等即覆盖』,使schedule中的具体站台名优先于NBT中的粗糙聚合名 - 新增trainName的同粒度校正:车次信息不一致时,同车次fuzzy匹配成功即采用权威id - BlockReader/CreateTarget两处预校正:解除『looksLikeValidDestinationText为false才替换』的限制,只要tryCorrect...返回的值与原值不同即替换——确保聚合名「千叶」这类『有效但粗糙』的文本也会被升级为具体站台名 - announceKey生成前的预校正与upcomingTrains赋值前的全局校正双保险,使冷却去重key与显示/广播目的地均完全对齐权威时刻表 版本升级至 v1.0.71
This commit is contained in:
+15
-9
@@ -3080,19 +3080,25 @@ local function tryCorrectUpcomingEntryWithCurrentTrain(entry)
|
||||
if not sameTrain and not samePlatform then return entry end
|
||||
local validId = looksLikeValidDestinationText(entry.trainName)
|
||||
local validDest = looksLikeValidDestinationText(entry.dest)
|
||||
|
||||
if not validId and ctId and ctId ~= "" then
|
||||
entry.trainName = ctId
|
||||
end
|
||||
if sameTrain and ctId and ctId ~= "" and tostring(entry.trainName or "") ~= tostring(ctId) then
|
||||
if Utils.isFuzzyMatch(entry.trainName or "", ctId) or not validId then
|
||||
entry.trainName = ctId
|
||||
end
|
||||
end
|
||||
|
||||
if not validDest and ctDest and ctDest ~= "" then
|
||||
entry.dest = ctDest
|
||||
elseif sameTrain and ctDest and ctDest ~= "" then
|
||||
if not Utils.isFuzzyMatch(entry.dest or "", ctDest) then
|
||||
local entryDestValid = looksLikeValidDestinationText(entry.dest)
|
||||
if not entryDestValid then
|
||||
end
|
||||
if (sameTrain or samePlatform) and ctDest and ctDest ~= "" and tostring(entry.dest or "") ~= tostring(ctDest) then
|
||||
if Utils.isFuzzyMatch(entry.dest or "", ctDest) or not validDest then
|
||||
entry.dest = ctDest
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return entry
|
||||
end
|
||||
|
||||
@@ -3223,10 +3229,10 @@ function Main.loop()
|
||||
platform = platform
|
||||
})
|
||||
if preCorrected then
|
||||
if not looksLikeValidDestinationText(trainName) and preCorrected.trainName then
|
||||
if preCorrected.trainName and tostring(preCorrected.trainName) ~= tostring(trainName) then
|
||||
trainName = preCorrected.trainName
|
||||
end
|
||||
if not looksLikeValidDestinationText(destination) and preCorrected.dest then
|
||||
if preCorrected.dest and tostring(preCorrected.dest) ~= tostring(destination) then
|
||||
destination = preCorrected.dest
|
||||
end
|
||||
end
|
||||
@@ -3384,10 +3390,10 @@ function Main.loop()
|
||||
platform = entryPlatform
|
||||
})
|
||||
if preCorrectedCT then
|
||||
if tName and not looksLikeValidDestinationText(tName) and preCorrectedCT.trainName then
|
||||
if preCorrectedCT.trainName and tostring(preCorrectedCT.trainName) ~= tostring(tName or "") then
|
||||
tName = preCorrectedCT.trainName
|
||||
end
|
||||
if dest and not looksLikeValidDestinationText(dest) and preCorrectedCT.dest then
|
||||
if preCorrectedCT.dest and tostring(preCorrectedCT.dest) ~= tostring(dest or "") then
|
||||
dest = preCorrectedCT.dest
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user