refactor(playout): move constants in config
This commit is contained in:
parent
fa7692071c
commit
1c50b28500
|
@ -7,6 +7,9 @@ from typing_extensions import Literal
|
|||
CACHE_DIR = Path.cwd() / "scheduler"
|
||||
RECORD_DIR = Path.cwd() / "recorder"
|
||||
|
||||
PUSH_INTERVAL = 2
|
||||
POLL_INTERVAL = 400
|
||||
|
||||
|
||||
class PlayoutConfig(BaseModel):
|
||||
liquidsoap_host: str = "localhost"
|
||||
|
|
|
@ -18,7 +18,7 @@ from libretime_api_client import version2 as api_client
|
|||
from loguru import logger
|
||||
|
||||
from . import pure
|
||||
from .config import CACHE_DIR, Config
|
||||
from .config import CACHE_DIR, POLL_INTERVAL, Config
|
||||
from .timeout import ls_timeout
|
||||
|
||||
|
||||
|
@ -29,8 +29,6 @@ def keyboardInterruptHandler(signum, frame):
|
|||
|
||||
signal.signal(signal.SIGINT, keyboardInterruptHandler)
|
||||
|
||||
POLL_INTERVAL = 400
|
||||
|
||||
|
||||
class PypoFetch(Thread):
|
||||
def __init__(
|
||||
|
|
|
@ -12,13 +12,11 @@ from threading import Thread
|
|||
from libretime_api_client import version1 as api_client
|
||||
from loguru import logger
|
||||
|
||||
from .config import Config
|
||||
from .config import PUSH_INTERVAL, Config
|
||||
from .pypofetch import PypoFetch
|
||||
from .pypoliqqueue import PypoLiqQueue
|
||||
from .timeout import ls_timeout
|
||||
|
||||
PUSH_INTERVAL = 2
|
||||
|
||||
|
||||
def is_stream(media_item):
|
||||
return media_item["type"] == "stream_output_start"
|
||||
|
|
|
@ -15,7 +15,7 @@ import pytz
|
|||
from libretime_api_client.version1 import AirtimeApiClient as AirtimeApiClientV1
|
||||
from loguru import logger
|
||||
|
||||
from libretime_playout.config import RECORD_DIR, Config
|
||||
from libretime_playout.config import PUSH_INTERVAL, RECORD_DIR, Config
|
||||
|
||||
|
||||
def api_client():
|
||||
|
@ -45,9 +45,6 @@ def getDateTimeObj(time):
|
|||
)
|
||||
|
||||
|
||||
PUSH_INTERVAL = 2
|
||||
|
||||
|
||||
class ShowRecorder(Thread):
|
||||
def __init__(
|
||||
self,
|
||||
|
|
Loading…
Reference in New Issue