Newer
Older
from src.rest.models.clock_info import ClockInfo # noqa: E501
from src.rest.models.health_log import HealthLog # noqa: E501
from src.rest.models.inline_response400 import InlineResponse400 # noqa: E501
from src.rest.models.play_log import PlayLog # noqa: E501
"""Adds an entry to the playlog
Stores the passed playlog entry # noqa: E501
body = PlayLog.from_dict(connexion.request.get_json()) # noqa: E501
def clock_info(): # noqa: E501
"""Get all information to display the studio clock
Retrieves the currently playing schedule, its playlist and entries plus the next schedule for being used by the studio clock. # noqa: E501
def get_active_source(): # noqa: E501
"""Get active play-out source (engine1, engine2)
Retrieves the status entry of the currently active source (engine 1, 2 or other source) # noqa: E501
service = current_app.config['SERVICE']
return service.get_active_source()
def get_report(year_month): # noqa: E501
"""Report for one month
:param year_month: Month to create the report for in the format \"yyyy_mm\"
:type year_month: str
def get_source_health(number): # noqa: E501
"""Get most recent health info
Retrieves the most recent health info of the requested engine # noqa: E501
:param number: Number of the engine
:type number: int
service = current_app.config['SERVICE']
return service.get_source_health(number)
def list_playlog(from_date=None, to_dat=None, page=None, limit=None, skip_synced=None): # noqa: E501
"""List tracks in the play-log since the given timestamp
Get paginated playlog entries for since the given timestamp. # noqa: E501
:param date_time: Get entries after this timestamp (e.g. '2020-08-29T09:12:33.001Z')
:param page: The number of items to skip before starting to collect the result set
:type page: int
:param limit: The numbers of items to return per page
:type limit: int
:param skip_synced: If true only returns items which are in unsynced state on the main node
:type skip_synced: bool
from_date = parse(from_date)
to_date = parse(to_date)
return service.list_playlog(page, limit, from_date, to_date, skip_synced)
"""Log health info
Logs another health entry for the given engine # noqa: E501
:param number: Number of the engine
:type number: int
:rtype: None
"""
if connexion.request.is_json:
body = HealthLog.from_dict(connexion.request.get_json()) # noqa: E501
service = current_app.config['SERVICE']
service.log_source_health(number, body)
def set_active_source(number): # noqa: E501
"""Set active play-out source (engine1, engine2)
Activates one engine and deactivates the other # noqa: E501
:param number: Number of the engine
:type number: int
service = current_app.config['SERVICE']
return service.set_active_source(number)