This can be achieved with the combination of two things:
* A `source.skip` on the playlist issued when the switch leaves the playlist
* A custom `on_track` function that tells the playlist to reload via its
`last_track` parameter.
More precisely, you will need to have a `should_reload` reference and set it to
true when skipping the track on the playlist. Something like this:
```
needs_reload = ref false
def transition(old,new) =
if source.id(old) == "myplaylist" then
needs_reload := true
source.skip(old)
end
sequence([old,new])
end
def on_track(~last,pos) =
if !needs_reload then
needs_reload := false
true
else
false
end
end
myplaylist = playlist(id="myplaylist",on_track=on_track,...)
# later:
radio = fallback(
track_sensitive=false,
transitions=[transition,transition,transition],
strip_blank(max_blank=120.,live_local), backup_playlist , security])
```
Hope that makes sense.
Gonna close the issue here. Please, feel free to continue the conversation at:
savonet-users@lists.sourceforge.net
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/savonet/liquidsoap/issues/530#issuecomment-401732712
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users