我有一個Liquidsoap很奇怪的問題。我有以下播放列表:Liquidsoap不會重新加載播放列表文件
myplaylist = playlist(mode="normal",playlist_file,reload_mode="rounds",reload=1)
myplaylist = on_metadata(apply_metadata,myplaylist)
其中apply_metadata調用一個python腳本調用時會立即更新播放列表,但有時Liquidsoap繼續播放舊的播放列表加載後,即使apply_metadata程序調用。
在此先感謝您的幫助。
的Liquidsoap腳本的全部代碼:
# 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)