diff --git a/src/rest/controllers/internal_controller.py b/src/rest/controllers/internal_controller.py index 6e3fd8f485a302df2b17e75439ab1ea854925ecd..d018861c66d1bdc7ebc7cbafef5ba979565800e9 100644 --- a/src/rest/controllers/internal_controller.py +++ b/src/rest/controllers/internal_controller.py @@ -35,7 +35,8 @@ def clock_info(): # noqa: E501 :rtype: ClockInfo """ - return 'do some magic!' + service = current_app.config['SERVICE'] + return service.get_clock_info() def get_active_source(): # noqa: E501 @@ -140,14 +141,17 @@ def set_active_source(number): # noqa: E501 return service.set_active_source(number) -def set_clock_info(number): # noqa: E501 +def set_clock_info(body): # noqa: E501 """Set current studio clock information such as schedule info and track-list for engine 1 or 2 - Set current studio clock information (schedule and track-list) of the given play-out source (engine1, engine2) # noqa: E501 + Set current studio clock information (source, schedule and track-list) and the next schedule of the given play-out source (engine1, engine2). Please note, the `current_track` information is ignored in the PUT request. It's only populated in the GET request. To store current track information use `/playlog/store` instead. # noqa: E501 - :param number: Number of the engine - :type number: int + :param body: + :type body: dict | bytes :rtype: None """ - return 'do some magic!' + if connexion.request.is_json: + body = ClockInfo.from_dict(connexion.request.get_json()) # noqa: E501 + service = current_app.config['SERVICE'] + return service.set_clock_info(body)