liquidsoapaac+

Liquid Soap 1.1 vs 1.3 - Dynamic playlist


Scenario:

  • Ubuntu 17.04
  • Liquid Soap 1.1.1 installed by apt-get
  • Liquid Soap 1.3.1 installed by OPAM

On 1.1.1, I cannot use AAC+ encoder. So I've installed 1.3.1 with AAC+ support. But using a same .liq file, both versions act different.

For some reason, 1.1 works, 1.3 not:

def my_request_function() =
  # Get the first line of my external process
  result = list.hd(get_process_lines("php -q liquid.php"))
  # Create and return a request using this result
  request.create(result)
end

Error:

At line 17, char 24:
  this value has type
    (default:_)->_ (inferred at line 15, char 19-58)
  but it should be a subtype of
    string

I want to read the "next song" from a PHP script. On 1.1.1 works with MP3 (+icecast2), but since I need AAC+, I'm using 1.3.1, that I cannot figure out how to read the external script.

Any ideas? Thank you.


Solution

  • 1.3 had another argument added to list.hd and other list functions. https://github.com/savonet/liquidsoap/blob/master/CHANGES#L52

    You can update your code with the new default value argument and it should work.

      result = list.hd(default="", get_process_lines("php -q liquid.php"))