2023-02-25 18:52:22 +01:00
|
|
|
from typing import List
|
|
|
|
|
|
|
|
from libretime_playout.config import Config
|
|
|
|
|
|
|
|
|
2023-03-30 20:39:02 +02:00
|
|
|
def make_config(**kwargs) -> Config:
|
2023-02-25 18:52:22 +01:00
|
|
|
return Config(
|
|
|
|
**{
|
|
|
|
"general": {
|
|
|
|
"public_url": "http://localhost:8080",
|
|
|
|
"api_key": "some_api_key",
|
2023-12-27 18:15:47 +01:00
|
|
|
"secret_key": "some_secret_key",
|
2023-02-25 18:52:22 +01:00
|
|
|
},
|
2023-03-30 20:39:02 +02:00
|
|
|
**kwargs,
|
2023-02-25 18:52:22 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2023-03-30 20:39:02 +02:00
|
|
|
def make_config_with_stream(**kwargs) -> Config:
|
|
|
|
return make_config(stream=kwargs)
|
|
|
|
|
|
|
|
|
2023-02-25 18:52:22 +01:00
|
|
|
TEST_STREAM_CONFIGS: List[Config] = [
|
2023-03-30 20:39:02 +02:00
|
|
|
make_config(),
|
|
|
|
make_config(
|
|
|
|
liquidsoap={
|
|
|
|
"harbor_ssl_certificate": "/fake/ssl.cert",
|
|
|
|
"harbor_ssl_private_key": "/fake/ssl.key",
|
|
|
|
},
|
|
|
|
stream={
|
|
|
|
"system": [{"enabled": True, "kind": "pulseaudio"}],
|
|
|
|
},
|
|
|
|
),
|
2023-02-25 18:52:22 +01:00
|
|
|
make_config_with_stream(
|
|
|
|
outputs={
|
|
|
|
"icecast": [
|
|
|
|
{
|
|
|
|
"enabled": True,
|
|
|
|
"mount": "main",
|
|
|
|
"source_password": "hackme",
|
|
|
|
"audio": {"format": "ogg", "bitrate": 256},
|
|
|
|
"name": "LibreTime!",
|
|
|
|
"description": "LibreTime Radio! Stream #1",
|
|
|
|
"website": "https://libretime.org",
|
|
|
|
"genre": "various",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"enabled": False,
|
|
|
|
"mount": "second",
|
|
|
|
"source_password": "hackme",
|
|
|
|
"audio": {"format": "mp3", "bitrate": 256},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
),
|
|
|
|
make_config_with_stream(
|
|
|
|
outputs={
|
|
|
|
"shoutcast": [
|
|
|
|
{
|
|
|
|
"enabled": True,
|
|
|
|
"source_password": "hackme",
|
|
|
|
"audio": {"format": "mp3", "bitrate": 256},
|
|
|
|
"name": "LibreTime!",
|
|
|
|
"description": "LibreTime Radio! Stream #1",
|
|
|
|
"website": "https://libretime.org",
|
|
|
|
"genre": "various",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
),
|
|
|
|
make_config_with_stream(
|
|
|
|
outputs={
|
|
|
|
"icecast": [
|
|
|
|
{
|
|
|
|
"enabled": True,
|
|
|
|
"mount": "main",
|
|
|
|
"source_password": "hackme",
|
|
|
|
"audio": {"format": "ogg", "bitrate": 256},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"shoutcast": [
|
|
|
|
{
|
|
|
|
"enabled": True,
|
|
|
|
"source_password": "hackme",
|
|
|
|
"audio": {"format": "mp3", "bitrate": 256},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
),
|
|
|
|
make_config_with_stream(
|
|
|
|
outputs={
|
|
|
|
"system": [{"enabled": True, "kind": "pulseaudio"}],
|
|
|
|
}
|
|
|
|
),
|
2023-12-29 15:22:43 +01:00
|
|
|
make_config_with_stream(
|
|
|
|
outputs={
|
|
|
|
"system": [
|
|
|
|
{
|
|
|
|
"enabled": True,
|
|
|
|
"kind": "pulseaudio",
|
|
|
|
"device": "alsa_output.pci-0000_00_sink",
|
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|
|
|
|
),
|
2023-02-25 18:52:22 +01:00
|
|
|
make_config_with_stream(
|
|
|
|
outputs={
|
|
|
|
"system": [{"enabled": False, "kind": "alsa"}],
|
|
|
|
}
|
|
|
|
),
|
|
|
|
]
|