fix: apply replay gain preferences on scheduled files (#2945)

### Description

The replay gain preferences are applied in the legacy code, but the
playout code was missing this feature. The replay gain was not applied
when playout fetched the schedules.


37d1a7685e/legacy/application/models/Schedule.php (L881-L886)
This commit is contained in:
Jonas L 2024-02-08 20:29:10 +01:00 committed by GitHub
parent 37d1a7685e
commit 35d0dec4a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 112 additions and 43 deletions

View file

@ -21,7 +21,12 @@ from .fixtures import TEST_STREAM_CONFIGS, make_config_with_stream
"stream_config",
TEST_STREAM_CONFIGS,
)
def test_generate_entrypoint(stream_config: Config, version, snapshot):
def test_generate_entrypoint(
stream_config: Config,
stream_preferences: StreamPreferences,
version,
snapshot,
):
with mock.patch(
"libretime_playout.liquidsoap.entrypoint.here",
Path("/fake"),
@ -29,11 +34,7 @@ def test_generate_entrypoint(stream_config: Config, version, snapshot):
found = generate_entrypoint(
log_filepath=Path("/var/log/radio.log"),
config=stream_config,
preferences=StreamPreferences(
input_fade_transition=0.0,
message_format=0,
message_offline="LibreTime - offline",
),
preferences=stream_preferences,
info=Info(
station_name="LibreTime",
),
@ -51,7 +52,11 @@ def test_generate_entrypoint(stream_config: Config, version, snapshot):
"stream_config",
TEST_STREAM_CONFIGS,
)
def test_liquidsoap_syntax(tmp_path: Path, stream_config):
def test_liquidsoap_syntax(
tmp_path: Path,
stream_config: Config,
stream_preferences: StreamPreferences,
):
entrypoint_filepath = tmp_path / "radio.liq"
log_filepath = tmp_path / "radio.log"
@ -59,11 +64,7 @@ def test_liquidsoap_syntax(tmp_path: Path, stream_config):
generate_entrypoint(
log_filepath=log_filepath,
config=stream_config,
preferences=StreamPreferences(
input_fade_transition=0.0,
message_format=0,
message_offline="LibreTime - offline",
),
preferences=stream_preferences,
info=Info(
station_name="LibreTime",
),
@ -79,7 +80,10 @@ def test_liquidsoap_syntax(tmp_path: Path, stream_config):
LIQ_VERSION >= (2, 0, 0),
reason="unsupported liquidsoap >= 2.0.0",
)
def test_liquidsoap_unsupported_output_aac(tmp_path: Path):
def test_liquidsoap_unsupported_output_aac(
tmp_path: Path,
stream_preferences: StreamPreferences,
):
entrypoint_filepath = tmp_path / "radio.liq"
log_filepath = tmp_path / "radio.log"
@ -98,11 +102,7 @@ def test_liquidsoap_unsupported_output_aac(tmp_path: Path):
]
}
),
preferences=StreamPreferences(
input_fade_transition=0.0,
message_format=0,
message_offline="LibreTime - offline",
),
preferences=stream_preferences,
info=Info(
station_name="LibreTime",
),