mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
refactor: migrate to OSC min
This commit is contained in:
@@ -5,6 +5,7 @@ import type { Request, Response } from 'express';
|
||||
|
||||
import * as automationDao from './automation.dao.js';
|
||||
import * as automationService from './automation.service.js';
|
||||
import { oscServer } from '../../adapters/OscAdapter.js';
|
||||
|
||||
export function getAutomationSettings(_req: Request, res: Response<AutomationSettings>) {
|
||||
res.json(automationDao.getAutomationSettings());
|
||||
@@ -20,6 +21,11 @@ export function postAutomationSettings(req: Request, res: Response<AutomationSet
|
||||
automations: req.body.automations ?? undefined,
|
||||
blueprints: req.body.blueprints ?? undefined,
|
||||
});
|
||||
if (automationSettings.enabledOscIn) {
|
||||
oscServer.init(automationSettings.oscPortIn);
|
||||
} else {
|
||||
oscServer.shutdown();
|
||||
}
|
||||
res.status(200).send(automationSettings);
|
||||
} catch (error) {
|
||||
const message = getErrorMessage(error);
|
||||
|
||||
Reference in New Issue
Block a user