From 944f00f5219c7bc9a8344114770eb23aac0e180e Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Sat, 1 Aug 2026 23:10:06 +0800 Subject: [PATCH] Fix: correctly parse nextStation by checking both create:station and create:destination, and handle schedule loop --- station_broadcast.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/station_broadcast.lua b/station_broadcast.lua index 924626b..ac7dbb1 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -2,7 +2,7 @@ -- ============================================================================ -- 1. Configuration & Constants -- ============================================================================ -local APP_VERSION_TEXT = "v1.0.16" +local APP_VERSION_TEXT = "v1.0.17" local CONFIG = { CLOUD_URL = "ws://stabadmin.fse-media.group", @@ -897,11 +897,22 @@ function Utils.getNextStation(schedule, currentStationName) end if matchFoundIndex then + -- Search forward for i = matchFoundIndex + 1, maxIdx do local entry = schedule.entries[i] if entry and entry.instruction then local inst = entry.instruction - if inst.id == "create:station" then + if inst.id == "create:station" or inst.id == "create:destination" then + return (inst.data and inst.data.text) or inst.text + end + end + end + -- Loop around to beginning + for i = 1, matchFoundIndex - 1 do + local entry = schedule.entries[i] + if entry and entry.instruction then + local inst = entry.instruction + if inst.id == "create:station" or inst.id == "create:destination" then return (inst.data and inst.data.text) or inst.text end end