liquidsoap icon indicating copy to clipboard operation
liquidsoap copied to clipboard

request.dynamic fetch 2 files on startup.

Open beauchette opened this issue 1 year ago • 3 comments

Describe the bug request.dynamic requests two files on startup. It doesn't work on 2.1.0 and 2.0.3, but it works with 1.4.3.

To Reproduce this script prints two files instead of one on startup:

set("log.file.path", "/opt/liquidsoap/liquidsoap.log")
set("server.telnet", true)
set("server.telnet.port", 1234)
set("server.telnet.bind_addr", "127.0.0.1")
set("init.daemon.pidfile.path","/opt/liquidsoap/liquidsoap.pid")

def req() =
  file = get_process_lines("/opt/liquidsoap/liquidsoap.js")
  print(file)
  result = list.hd( default = "", file)
  request.create(result)
end

s = request.dynamic(prefetch = 1, req)

security = single("/opt/liquidsoap/fallback.ogg")

radio = fallback(track_sensitive = false, [s, security])

output.icecast(%mp3(bitrate=320,id3v2=true),
  host = "localhost", port = 8000, protocol = "http",
  password = "blah", mount = "blah.mp3",
        url="blah", name="blah", description="blah",
  radio)

Expected behavior Only 1 file should be asked of my script.

Version details

  • OS: Debian GNU/Linux 11 (bullseye)
  • Version 2.1.0 has this problem
  • Version 2.0.3 has this problem
  • Version 1.4.3 works fine (but you have to remove prefetch = 1 from request.dynamic)

Install method All versions were installed through opam

beauchette avatar Aug 30 '22 08:08 beauchette