Liquidsoap does not reload playlist file

I have a very strange problem with Liquidsoap. I have the following playlist:

myplaylist = playlist(mode="normal",playlist_file,reload_mode="rounds",reload=1) myplaylist = on_metadata(apply_metadata,myplaylist) 

where apply_metadata calls a python script that immediately updates the playlist when invoked, but sometimes Liquidsoap continues to play the old playlist after a reboot, even if the apply_metadata procedure was called.

Thanks in advance for your help.

All Liquidsoap script code:

 # This function is called when # a new metadata block is passed in # the stream. def apply_metadata(m) = title = m["filename"] artist = m["artist"] print("Now playing: #{title} by #{artist}") filename = string.split(separator="/",title) # rozdelime cestu po lomitkach filename = list.nth(list.rev(filename),0) # vezmeme meno suboru filename = list.nth(string.split(separator="\.",filename),0) # odpojime koncovku .mp3 command = "python3.3 feedback.py " ^ filename system(command) end #!/usr/bin/liquidsoap # Log dir set("log.file.path","/tmp/basic-radio.log") #tidy up before playing playlist playlist_file = "playlist.m3u" system("python3.3 feedback.py -init") # Music myplaylist = playlist(mode="normal",playlist_file,reload_mode="rounds",reload=1) myplaylist = on_metadata(apply_metadata,myplaylist) # Stream it out output.icecast(%mp3, host = "localhost", port = 8080, password = "baldur", mount = "stream", myplaylist, fallible=true) 
+4
source share
2 answers

Finally, I found the solution requested on the Liquidsoap mailing list :

First, although it seems to me that you might use playlist () in a way that is not intended.

Do you have about using request.dynamic? This operator gives you complete control over which song will be played next, and the next track callback can be recorded in any language you choose, which also makes it more convenient.

Good luck

Romny

+3
source

You can also use

 myplaylist = playlist(mode="normal",playlist_file,reload_mode="watch") 

This will reload the playlist as soon as it detects any changes.

0
source

Source: https://habr.com/ru/post/1495553/


All Articles