'Liquidsoap request.dynamic

I would like to create a dynamic playlist. I am using an external bash script to generate multiple paths to audio files, I am using request.dynamic for that but it seems like it only reads the first line of the output of my bash script. Can anyone please help me? Any help or suggestion would be appreciated. Thanks

Here is my liquidsoap script :

set ("log.file.path","/home/admin/radio.log")

def my_request_function() = 

  result =
    list.hd(default="", get_process_lines("sh testScript.sh"))
  
  request.create(result, persistent=true)

end


m = request.dynamic(my_request_function)
m = audio_to_stereo(m)

radio = m

 
 clock.assign_new(id="/stream",[output.icecast(%vorbis(samplerate=44100, channels=2, quality=0.3),format="audio/ogg", fallible=true, host = "ip address", port = 8080 , password="password",  mount = "/test1",radio)])

Here is my bash script :

#!/bin/bash

now="$(date +'%Y-%m-%d')"

cd Playlist

cd Musique

cat $now*

and here is the result of it :

./Audio/147/n.mp3 
./Audio/150/test.mp3 
./Audio/308/eee.mp3


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source