Thanks! I understand the logic of that code, but this made me realize I
don't know how to make static metadata replacement work. I need to
understand that before proceeding with hooking into external scripts.
After spending some time looking around and experimenting, I've modified
my script to this:
#!/usr/local/bin/liquidsoap -t
set("log.file.path","/home/audiodef/radio/liquidradio.log")
set("log.level",4)
main_radio=mksafe(playlist(timeout=3600.,conservative=true,"http://synthetronica/radio/main_playlist"))
pattern = '$(if $(display_artist),"Synthetronica Radio","Synthetronica
Radio: $(artist)")'
main_radio=rewrite_metadata([("artist",pattern)],main_radio)
pattern = '$(if $(display_title),"Various Artists","$(title)")'
main_radio=rewrite_metadata([("title",pattern)],main_radio)
output.icecast(%vorbis(quality=0.6,samplerate=44100),
host="localhost", port=8000,
password="(password)", mount="radio.ogg", name="Synthetronica
Radio",
description="Eclectic Electronica", genre="Electronic",
url="synthetronica",
main_radio)
This works - technically. But it doesn't do what I want, because the
fields display_artist and display_title exist for many of the tracks in
my playlist, but are empty. How do I modify this script so that if these
fields do not exist, or they do exist but are empty, my stream should
say "Synthetronica Radio - Various Artists" in Audacious (or whatever
media player)?
Once I understand how to do this, I'll be ready to proceed to calling
external scripts. I would really appreciate any help on this part.
Also, is there a page documenting all of the metadata fields? The only
reason I know about display_artist and display_title is because it was
in an example in the documentation. I haven't found these anywhere else,
so I'm hoping I simply did not know where to look.
Thanks!
Damien
On 06/27/12 23:46, [email protected] wrote:
> If it's any help, I use the following to get the value of the current
> title from
> a database entry (where 'title.txt' is a returned value):
>
>
> elsif m["filename"] ==
> "/usr/local/www/rcr/radio/current/special/mp3/today-special-mp3-32.pls" then
>
> content = list.hd(get_process_lines("cat
> /usr/local/www/rcr/radio/current/special/mp3/title.txt"))
> ("title", "Special Program - #{content}")
>
> Hth
>
>
> On Wed, 27 Jun 2012 17:10:16 -0400, Audiodef Online
> <[email protected]> wrote:
>
>> Thanks, Martin.
>>
>> But I have to confess to not knowing how to use this:
>>
>> (string)->[string]
>>
>> Perform a shell call and return the list of its output lines.
>>
>> (unlabeled) (string)
>>
>> I don't need hand-holding, but I learn best from examples. Is there
>> an example
>> somewhere I can read to see how it actually works in practice?
>>
>> Thanks,
>> Damien
>>
>>
>> On 06/27/12 20:32, Martin Konečný wrote:
>>
>> Look up "get_process_lines" function call.
>>
>>
>> http://savonet.sourceforge.net/doc-1.0.0/reference.html
>>
>>
>>
>>
>> O Wed, Jun 27, 2012 at 4:29 PM, Audiodef Online <[email protected]>
>> wrote:
>>
>> Is it possible to have a LS script execute an external script, wait for
>> the external script to return a value, and use that value?
>>
>> Specifically, I would like my LS script to parse the stream's metadata.
>> If the metadata has the literal string "unknown" (case insensitive) as
>> the title of the track, then the LS script should execute a PHP script
>> (via CGI, of course) and store the result of that script (which would be
>> exactly one value - a string) and then set the metadata of the current
>> track with the string retrieved from the PHP script.
>>
>> Can I do this? How would it be done?
>>
>> --
>> My music: http://audiodef.com
>> Synthetronica: http://synthetronica.com
>> Male survivors of domestic violence: http://abusedmen.org
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond.
>> Discussions
>> will include endpoint security, mobile security and the latest in
>> malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>>
>>
>
>
--
My music: http://audiodef.com
Synthetronica: http://synthetronica.com
Male survivors of domestic violence: http://abusedmen.org
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users