From 716a23cad5c1b57791fb832c31322a214b928677 Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Sun, 16 Aug 2026 13:05:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(data):=20=E4=BF=AE=E5=A4=8D=E6=9D=83?= =?UTF-8?q?=E5=A8=81=E6=97=B6=E5=88=BB=E8=A1=A8=E4=B8=8ENBT=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=B2=92=E5=BA=A6=E4=B8=8D=E4=B8=80=E8=87=B4=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=BB=88=E7=82=B9=E7=AB=99=E6=BC=8F=E6=92=AD(?= =?UTF-8?q?=E3=80=8C=E5=8D=83=E5=8F=B6=E3=80=8D=E8=81=9A=E5=90=88=E5=90=8D?= =?UTF-8?q?=20vs=E3=80=8C=E5=8D=83=E5=8F=B6CB-03=206=E3=80=8D=E5=85=B7?= =?UTF-8?q?=E4=BD=93=E7=AB=99=E5=8F=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tryCorrectUpcomingEntryWithCurrentTrain: 校正逻辑从『仅无效乱码才覆盖』改为『同站fuzzy匹配且字符串不等即覆盖』,使schedule中的具体站台名优先于NBT中的粗糙聚合名 - 新增trainName的同粒度校正:车次信息不一致时,同车次fuzzy匹配成功即采用权威id - BlockReader/CreateTarget两处预校正:解除『looksLikeValidDestinationText为false才替换』的限制,只要tryCorrect...返回的值与原值不同即替换——确保聚合名「千叶」这类『有效但粗糙』的文本也会被升级为具体站台名 - announceKey生成前的预校正与upcomingTrains赋值前的全局校正双保险,使冷却去重key与显示/广播目的地均完全对齐权威时刻表 版本升级至 v1.0.71 --- station_broadcast.lua | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/station_broadcast.lua b/station_broadcast.lua index 84bde65..e329200 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -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 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 - entry.dest = ctDest - 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 + 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 + 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