feat(playout): use single clients instance (#1980)
- Use legacy_client across playout code to make the difference between the old and new clients. - Setup clients during initialization, and pass clients down to the different apps.
This commit is contained in:
parent
f03605a6ce
commit
368350b269
9 changed files with 49 additions and 43 deletions
|
@ -5,7 +5,7 @@ import traceback
|
|||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from libretime_api_client.v1 import ApiClient
|
||||
from libretime_api_client.v1 import ApiClient as LegacyClient
|
||||
from loguru import logger
|
||||
|
||||
|
||||
|
@ -50,8 +50,8 @@ def generate_entrypoint(log_filepath: Optional[Path]):
|
|||
|
||||
while not successful:
|
||||
try:
|
||||
ac = ApiClient(logger)
|
||||
ss = ac.get_stream_setting()
|
||||
legacy_client = LegacyClient(logger)
|
||||
ss = legacy_client.get_stream_setting()
|
||||
generate_liquidsoap_config(ss, log_filepath)
|
||||
successful = True
|
||||
except Exception as e:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import sys
|
||||
|
||||
from libretime_api_client.v1 import ApiClient
|
||||
from libretime_api_client.v1 import ApiClient as LegacyClient
|
||||
|
||||
api_client = ApiClient()
|
||||
legacy_client = LegacyClient()
|
||||
|
||||
dj_type = sys.argv[1]
|
||||
username = sys.argv[2]
|
||||
|
@ -14,7 +14,7 @@ if dj_type == "--master":
|
|||
elif dj_type == "--dj":
|
||||
source_type = "dj"
|
||||
|
||||
response = api_client.check_live_stream_auth(username, password, source_type)
|
||||
response = legacy_client.check_live_stream_auth(username, password, source_type)
|
||||
|
||||
if "msg" in response and response["msg"] == True:
|
||||
print(response["msg"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue