mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
chore: cleanup
This commit is contained in:
committed by
Carlos Valente
parent
8f249b9d51
commit
5cf5b2fae3
@@ -120,7 +120,7 @@ export class SocketServer implements IAdapter {
|
|||||||
if (reply) {
|
if (reply) {
|
||||||
ws.send(
|
ws.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: 'ontime-change',
|
type,
|
||||||
payload: reply.payload,
|
payload: reply.payload,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ const actionHandlers: Record<string, ActionHandler> = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
updateEvent(patchEvent);
|
updateEvent(patchEvent);
|
||||||
Object.assign(patchEvent);
|
|
||||||
|
|
||||||
return { payload: 'success' };
|
return { payload: 'success' };
|
||||||
},
|
},
|
||||||
@@ -75,7 +74,7 @@ const actionHandlers: Record<string, ActionHandler> = {
|
|||||||
/* Playback */
|
/* Playback */
|
||||||
start: (payload) => {
|
start: (payload) => {
|
||||||
if (payload === undefined) {
|
if (payload === undefined) {
|
||||||
return successPayloadOrError(runtimeService.start(), 'Uable to start');
|
return successPayloadOrError(runtimeService.start(), 'Unable to start');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload && typeof payload === 'object') {
|
if (payload && typeof payload === 'object') {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ErrorResponse, LogOrigin, RuntimeStore } from 'ontime-types';
|
import { LogOrigin } from 'ontime-types';
|
||||||
|
|
||||||
import express, { type Request, type Response } from 'express';
|
import express, { type Request, type Response } from 'express';
|
||||||
|
|
||||||
@@ -14,7 +14,6 @@ import { integrationPayloadFromPath } from '../adapters/utils/parse.js';
|
|||||||
|
|
||||||
import { dispatchFromAdapter } from './integration.controller.js';
|
import { dispatchFromAdapter } from './integration.controller.js';
|
||||||
import { getErrorMessage } from 'ontime-utils';
|
import { getErrorMessage } from 'ontime-utils';
|
||||||
import { eventStore } from '../stores/EventStore.js';
|
|
||||||
import { isEmptyObject } from '../utils/parserUtils.js';
|
import { isEmptyObject } from '../utils/parserUtils.js';
|
||||||
|
|
||||||
export const integrationRouter = express.Router();
|
export const integrationRouter = express.Router();
|
||||||
@@ -52,13 +51,3 @@ integrationRouter.get('/*', (req: Request, res: Response) => {
|
|||||||
res.status(500).send({ message: errorMessage });
|
res.status(500).send({ message: errorMessage });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
integrationRouter.get('/poll', (_req: Request, res: Response<Partial<RuntimeStore> | ErrorResponse>) => {
|
|
||||||
try {
|
|
||||||
const state = eventStore.poll();
|
|
||||||
res.status(200).send(state);
|
|
||||||
} catch (error) {
|
|
||||||
const message = getErrorMessage(error);
|
|
||||||
res.status(500).send({ message: `Could not get sync data: ${message}` });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const whitelistedPayload = {
|
|||||||
note: coerceString,
|
note: coerceString,
|
||||||
cue: coerceString,
|
cue: coerceString,
|
||||||
|
|
||||||
duration: (value: unknown) => coerceNumber(value) * 1000, //frontend is seconds based
|
duration: (value: unknown) => coerceNumber(value) * 1000,
|
||||||
|
|
||||||
isPublic: coerceBoolean,
|
isPublic: coerceBoolean,
|
||||||
skip: coerceBoolean,
|
skip: coerceBoolean,
|
||||||
|
|||||||
Reference in New Issue
Block a user