fix(station): allow music to restart after stop

Keep the active music stream attached until Audio.stop runs so stop requests finish the stream reader cleanly and the next music playback can start again without getting stuck behind the previous stream.
This commit is contained in:
2026-08-01 08:36:01 +08:00
parent 69badb6853
commit 529c871b0e
+4 -6
View File
@@ -2,7 +2,7 @@
-- ============================================================================ -- ============================================================================
-- 1. Configuration & Constants -- 1. Configuration & Constants
-- ============================================================================ -- ============================================================================
local APP_VERSION_TEXT = "v1.0.9" local APP_VERSION_TEXT = "v1.0.10"
local CONFIG = { local CONFIG = {
CLOUD_URL = "ws://stabadmin.fse-media.group", CLOUD_URL = "ws://stabadmin.fse-media.group",
@@ -1628,11 +1628,9 @@ function Network.messageLoop()
end end
State.audioQueue = kept State.audioQueue = kept
if State.audioRx and tostring(State.audioRx.source or "") == "music" then local hasMusicRx = State.audioRx and tostring(State.audioRx.source or "") == "music"
State.audioRx = nil local hasMusicCurrent = State.currentPlaying and tostring(State.currentPlaying.source or "") == "music"
end if hasMusicRx or hasMusicCurrent then
if State.currentPlaying and tostring(State.currentPlaying.source or "") == "music" then
Audio.stop("current") Audio.stop("current")
end end
else else