From: Mix D. <adm...@mi...> - 2011-07-02 19:57:44
|
Le 27/06/2011 13:28, David Baelde a écrit : > Hi, > > Here is a fully functioning example: > > def update_title(m) > title = m["title"] > filename = m["filename"] > match = string.extract(pattern="podcast\s*([0-9]+).mp3",filename) > podnum = match["1"] > [("title","#{title} #{podnum}")] > end > s = single("podcast 1313.mp3") > s = on_metadata(fun(m)->log("BEFORE #{m}"),s) > s = map_metadata(update_title,s) > s = on_metadata(fun(m)->log("AFTER #{m}"),s) > output.dummy(fallible=true,s) > > You should be able to adapt it immediately to your script. If it does > not work as expected, you need to learn the usual debugging > techniques: first, logging the metadata at various points like I did > above; next, using sample scripts, one-liners and interactive mode to > try simple expressions and make sure they behave as expected. > > Have fun, > > David Hi David! I have tested your script and it work! Big thanks for you help! Actually, i think exported all my script in the dynamic playlist method, so to control all diffusions and musics from a PHP script or other. I will launch a new topic, but before, i would like know if is it a good idea, and What do I need to know for to have a good result. Thanks for your help Antoine |