fix: parse CRN ETA as value plus unit
This commit is contained in:
@@ -2428,15 +2428,16 @@ function Main.loop()
|
||||
for _, lineText in pairs(lines) do
|
||||
if lineText and lineText ~= "" and lineText:match("[%w%?%[]") then
|
||||
local cleanLine = string.gsub(lineText, "%s*%(?%+%s*%d+.-%)?", "")
|
||||
local platform, etaStr, tName, dest
|
||||
platform, etaStr, tName, dest = string.match(cleanLine, "^(%d+)%s+(.-)%s+(%[.-%][^%s]*)%s+(.*)$")
|
||||
local etaValue, etaUnit, tName, dest
|
||||
etaValue, etaUnit, tName, dest = string.match(cleanLine, "^(%S+)%s+(.-)%s+(%[.-%][^%s]*)%s+(.*)$")
|
||||
if not tName then
|
||||
platform, etaStr, tName, dest = string.match(cleanLine, "^([^%s]+)%s+(.-)%s+(%[.-%][^%s]*)%s+(.*)$")
|
||||
etaValue, etaUnit, tName, dest = string.match(cleanLine, "^([^%s]+)%s+(.-)%s+([^%s]+)%s+(.*)$")
|
||||
end
|
||||
if not tName then
|
||||
platform, etaStr, tName, dest = string.match(cleanLine, "^([^%s]+)%s+(.-)%s+([^%s]+)%s+(.*)$")
|
||||
end
|
||||
if tName and etaStr then
|
||||
if tName and etaValue then
|
||||
local etaStr = tostring(etaValue or "")
|
||||
if etaUnit and etaUnit ~= "" then
|
||||
etaStr = etaStr .. " " .. tostring(etaUnit)
|
||||
end
|
||||
local etaSeconds = parseEtaText(etaStr)
|
||||
if dest then
|
||||
local textKey = tName .. "_" .. dest
|
||||
|
||||
Reference in New Issue
Block a user