fix(playout): remove outdated liquidsoap code

Fixes #1482
This commit is contained in:
jo 2022-09-09 20:59:37 +02:00 committed by Kyle Robbertze
parent dbfb22646a
commit 1742890370
4 changed files with 1 additions and 140 deletions

View File

@ -29,31 +29,10 @@ def check_version(~version=liquidsoap.version, major, minor) =
list.nth(v,0,default=0) > major or list.nth(v,0,default=0) == major and list.nth(v,1,default=0) >= minor
end
# cue cut fix for liquidsoap <1.2.2
#
# This was most likely broken on 1.1.1 (debian) as well.
#
# adapted from https://github.com/savonet/liquidsoap/issues/390#issuecomment-277562081
#
def fix_cue_in(~cue_in_metadata='liq_cue_in', m) =
# 0.04 might need to be adjusted according to your frame size
if float_of_string(m[cue_in_metadata]) < 0.04 then
[(cue_in_metadata, "0")]
else
[]
end
end
def create_source()
l = request.equeue(id="s#{!source_id}", length=0.5)
l = audio_to_stereo(id="queue_src", l)
l = if not check_version(1, 3) then
map_metadata(fix_cue_in, l)
else
l
end
l = cue_cut(l)
l = amplify(1., override="replay_gain", l)

View File

@ -47,11 +47,7 @@ set("server.telnet", true)
set("server.telnet.bind_addr", "{{ config.liquidsoap.server_listen_address }}")
set("server.telnet.port", {{ config.liquidsoap.server_listen_port }})
{% if version >= (1, 3, 3) -%}
set("harbor.bind_addrs", ["{{ config.liquidsoap.harbor_listen_address | join('", "') }}"])
{%- else -%}
set("harbor.bind_addr", "{{ config.liquidsoap.harbor_listen_address[0] }}")
{%- endif %}
station_name = ref "{{ info.station_name }}"

View File

@ -1,114 +1,3 @@
# name: test_generate_entrypoint[1.1]
'''
# THIS FILE IS AUTO GENERATED. PLEASE DO NOT EDIT!
###########################################################
# The ignore() lines are to squash unused variable warnings
# Inputs
master_live_stream_mp = "main"
master_live_stream_port = 8001
dj_live_stream_mp = "show"
dj_live_stream_port = 8002
# Output s1
s1_enable = true
s1_output = "icecast"
s1_host = "localhost"
s1_port = 8000
s1_mount = "main"
s1_user = "source"
s1_pass = "hackme"
s1_channels = "stereo"
s1_type = "ogg"
s1_bitrate = 256
s1_name = "LibreTime!"
s1_description = "LibreTime Radio! Stream #1"
s1_genre = "various"
s1_url = "https://libretime.org"
# Output s2
s2_enable = true
s2_output = "icecast"
s2_host = "localhost"
s2_port = 8000
s2_mount = "second"
s2_user = "source"
s2_pass = "hackme"
s2_channels = "stereo"
s2_type = "mp3"
s2_bitrate = 256
s2_name = ""
s2_description = ""
s2_genre = ""
s2_url = ""
# Output s3
s3_enable = false
s3_output = "icecast"
s3_host = "localhost"
s3_port = 8000
s3_mount = ""
s3_user = "source"
s3_pass = ""
s3_channels = "stereo"
s3_type = "ogg"
s3_bitrate = 256
s3_name = ""
s3_description = ""
s3_genre = ""
s3_url = ""
# Output s4
s4_enable = false
s4_output = "icecast"
s4_host = "localhost"
s4_port = 8000
s4_mount = ""
s4_user = "source"
s4_pass = ""
s4_channels = "stereo"
s4_type = "ogg"
s4_bitrate = 256
s4_name = ""
s4_description = ""
s4_genre = ""
s4_url = ""
icecast_vorbis_metadata = false
# System output
output_sound_device = false
output_sound_device_type = "alsa"
# Settings
auth_path = "/fake/liquidsoap_auth.py"
set("log.file.path", "/var/log/radio.log")
set("server.telnet", true)
set("server.telnet.bind_addr", "127.0.0.1")
set("server.telnet.port", 1234)
set("harbor.bind_addr", "0.0.0.0")
station_name = ref "LibreTime"
off_air_meta = ref "LibreTime - offline"
stream_metadata_type = ref 0
default_dj_fade = ref 0.0
%include "/fake/1.1/ls_script.liq"
'''
# ---
# name: test_generate_entrypoint[1.4]
'''
# THIS FILE IS AUTO GENERATED. PLEASE DO NOT EDIT!

View File

@ -10,10 +10,7 @@ from libretime_playout.liquidsoap.models import Info, StreamPreferences
@pytest.mark.parametrize(
"version",
[
pytest.param((1, 1, 1), id="1.1"),
pytest.param((1, 4, 4), id="1.4"),
],
[pytest.param((1, 4, 4), id="1.4")],
)
def test_generate_entrypoint(tmp_path: Path, config: Config, version, snapshot):
entrypoint_filepath = tmp_path / "radio.liq"