From 453ecd13534006876df40efc87e84d75688a5284 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 3 Jul 2026 09:52:14 +0800 Subject: [PATCH] stream: fix jingle counter for liquidsoap 2.4.5 (on_track is a method) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the pinned savonet/liquidsoap:v2.4.5 image, `source.on_track` no longer exists as a module function — on_track is a method on the source value. The old `music = source.on_track(music, …)` form fails type-checking, so the whole radio.liq is rejected and the stream container never starts. Register the handler in place via the method form instead. Co-Authored-By: Claude Opus 4.8 --- stream/radio.liq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream/radio.liq b/stream/radio.liq index 5e1be77..4a5ab4d 100644 --- a/stream/radio.liq +++ b/stream/radio.liq @@ -86,7 +86,7 @@ jingles = playlist( # déclenche que sur la source effectivement tirée par le switch (les sources # non sélectionnées ne sont pas consommées), donc les jingles ne comptent pas. song_count = ref(0) -music = source.on_track(music, fun(_) -> song_count := song_count() + 1) +music.on_track(synchronous=false, fun(_) -> song_count := song_count() + 1) # Prédicat du switch : vrai quand 2 chansons ont été diffusées depuis le dernier # jingle. Il remet le compteur à zéro au passage pour repartir sur un cycle neuf.