mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-05 15:33:59 +00:00
Compare commits
5 Commits
custom-fields
...
v3.4.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 71317f5e40 | |||
| cc14445252 | |||
| 31316a6661 | |||
| a8bc4eb098 | |||
| 807698aee1 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@getontime/cli",
|
"name": "@getontime/cli",
|
||||||
"version": "3.4.0",
|
"version": "3.4.2",
|
||||||
"author": "Carlos Valente",
|
"author": "Carlos Valente",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"repository": "https://github.com/cpvalente/ontime",
|
"repository": "https://github.com/cpvalente/ontime",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime-ui",
|
"name": "ontime-ui",
|
||||||
"version": "3.4.0",
|
"version": "3.4.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime",
|
"name": "ontime",
|
||||||
"version": "3.4.0",
|
"version": "3.4.2",
|
||||||
"author": "Carlos Valente",
|
"author": "Carlos Valente",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"repository": "https://github.com/cpvalente/ontime",
|
"repository": "https://github.com/cpvalente/ontime",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "ontime-server",
|
"name": "ontime-server",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"version": "3.4.0",
|
"version": "3.4.2",
|
||||||
"exports": "./src/index.js",
|
"exports": "./src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@googleapis/sheets": "^5.0.5",
|
"@googleapis/sheets": "^5.0.5",
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
import { ErrorResponse, MessageResponse, OntimeRundownEntry, RundownCached, RundownPaginated } from 'ontime-types';
|
import {
|
||||||
|
ErrorResponse,
|
||||||
|
MessageResponse,
|
||||||
|
OntimeRundown,
|
||||||
|
OntimeRundownEntry,
|
||||||
|
RundownCached,
|
||||||
|
RundownPaginated,
|
||||||
|
} from 'ontime-types';
|
||||||
import { getErrorMessage } from 'ontime-utils';
|
import { getErrorMessage } from 'ontime-utils';
|
||||||
|
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
@@ -21,6 +28,11 @@ import {
|
|||||||
getRundown,
|
getRundown,
|
||||||
} from '../../services/rundown-service/rundownUtils.js';
|
} from '../../services/rundown-service/rundownUtils.js';
|
||||||
|
|
||||||
|
export async function rundownGetAll(_req: Request, res: Response<OntimeRundown>) {
|
||||||
|
const rundown = getRundown();
|
||||||
|
res.json(rundown);
|
||||||
|
}
|
||||||
|
|
||||||
export async function rundownGetNormalised(_req: Request, res: Response<RundownCached>) {
|
export async function rundownGetNormalised(_req: Request, res: Response<RundownCached>) {
|
||||||
const cachedRundown = getNormalisedRundown();
|
const cachedRundown = getNormalisedRundown();
|
||||||
res.json(cachedRundown);
|
res.json(cachedRundown);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
rundownApplyDelay,
|
rundownApplyDelay,
|
||||||
rundownBatchPut,
|
rundownBatchPut,
|
||||||
rundownDelete,
|
rundownDelete,
|
||||||
|
rundownGetAll,
|
||||||
rundownGetById,
|
rundownGetById,
|
||||||
rundownGetNormalised,
|
rundownGetNormalised,
|
||||||
rundownGetPaginated,
|
rundownGetPaginated,
|
||||||
@@ -26,7 +27,8 @@ import {
|
|||||||
|
|
||||||
export const router = express.Router();
|
export const router = express.Router();
|
||||||
|
|
||||||
router.get('/', rundownGetPaginatedQueryParams, rundownGetPaginated); // not used in Ontime frontend
|
router.get('/', rundownGetAll); // not used in Ontime frontend
|
||||||
|
router.get('/paginated', rundownGetPaginatedQueryParams, rundownGetPaginated); // not used in Ontime frontend
|
||||||
router.get('/normalised', rundownGetNormalised);
|
router.get('/normalised', rundownGetNormalised);
|
||||||
router.get('/:eventId', paramsMustHaveEventId, rundownGetById); // not used in Ontime frontend
|
router.get('/:eventId', paramsMustHaveEventId, rundownGetById); // not used in Ontime frontend
|
||||||
|
|
||||||
|
|||||||
@@ -54,18 +54,15 @@ const actionHandlers: Record<string, ActionHandler> = {
|
|||||||
if (typeof property !== 'string' || value === undefined) {
|
if (typeof property !== 'string' || value === undefined) {
|
||||||
throw new Error('Invalid property or value');
|
throw new Error('Invalid property or value');
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseProperty is async because of the data lock
|
// parseProperty is async because of the data lock
|
||||||
parseProperty(property, value).then((newObjectProperty) => {
|
const newObjectProperty = parseProperty(property, value);
|
||||||
const key = Object.keys(newObjectProperty)[0] as keyof OntimeEvent;
|
const key = Object.keys(newObjectProperty)[0] as keyof OntimeEvent;
|
||||||
shouldThrottle = willCauseRegeneration(key) || shouldThrottle;
|
shouldThrottle = shouldThrottle || willCauseRegeneration(key);
|
||||||
|
if (patchEvent.custom && newObjectProperty.custom) {
|
||||||
if (patchEvent.custom && newObjectProperty.custom) {
|
Object.assign(patchEvent.custom, newObjectProperty.custom);
|
||||||
Object.assign(patchEvent.custom, newObjectProperty.custom);
|
} else {
|
||||||
} else {
|
Object.assign(patchEvent, newObjectProperty);
|
||||||
Object.assign(patchEvent, newObjectProperty);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (shouldThrottle) {
|
if (shouldThrottle) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const propertyConversion = {
|
|||||||
timeEnd: (value: unknown) => clampDuration(coerceNumber(value)),
|
timeEnd: (value: unknown) => clampDuration(coerceNumber(value)),
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function parseProperty(property: string, value: unknown) {
|
export function parseProperty(property: string, value: unknown) {
|
||||||
if (property.startsWith('custom:')) {
|
if (property.startsWith('custom:')) {
|
||||||
const customKey = property.split(':')[1].toLocaleLowerCase(); // all custom fields keys are lowercase
|
const customKey = property.split(':')[1].toLocaleLowerCase(); // all custom fields keys are lowercase
|
||||||
const customFields = getDataProvider().getCustomFields();
|
const customFields = getDataProvider().getCustomFields();
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime",
|
"name": "ontime",
|
||||||
"version": "3.4.0",
|
"version": "3.4.2",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ontime",
|
"ontime",
|
||||||
|
|||||||
Reference in New Issue
Block a user