mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
feat: automation service
This commit is contained in:
committed by
Carlos Valente
parent
a8fe4c8e68
commit
05e61e7bf8
@@ -8,6 +8,7 @@ import {
|
||||
CustomFields,
|
||||
HttpSettings,
|
||||
URLPreset,
|
||||
AutomationSettings,
|
||||
} from 'ontime-types';
|
||||
|
||||
import type { Low } from 'lowdb';
|
||||
@@ -56,6 +57,8 @@ export function getDataProvider() {
|
||||
setViewSettings,
|
||||
setOsc,
|
||||
setHttp,
|
||||
getAutomation,
|
||||
setAutomation,
|
||||
getRundown,
|
||||
mergeIntoData,
|
||||
};
|
||||
@@ -137,10 +140,21 @@ async function setOsc(newData: OSCSettings): ReadonlyPromise<OSCSettings> {
|
||||
|
||||
async function setHttp(newData: HttpSettings): ReadonlyPromise<HttpSettings> {
|
||||
db.data.http = { ...newData };
|
||||
|
||||
await persist();
|
||||
return db.data.http;
|
||||
}
|
||||
|
||||
function getAutomation(): Readonly<AutomationSettings> {
|
||||
return db.data.automation;
|
||||
}
|
||||
|
||||
async function setAutomation(newData: AutomationSettings): ReadonlyPromise<AutomationSettings> {
|
||||
db.data.automation = { ...newData };
|
||||
await persist();
|
||||
return db.data.automation;
|
||||
}
|
||||
|
||||
function getRundown(): Readonly<OntimeRundown> {
|
||||
return db.data.rundown;
|
||||
}
|
||||
@@ -150,6 +164,7 @@ async function mergeIntoData(newData: Partial<DatabaseModel>): ReadonlyPromise<D
|
||||
db.data.project = mergedData.project;
|
||||
db.data.settings = mergedData.settings;
|
||||
db.data.viewSettings = mergedData.viewSettings;
|
||||
db.data.automation = mergedData.automation;
|
||||
db.data.osc = mergedData.osc;
|
||||
db.data.http = mergedData.http;
|
||||
db.data.urlPresets = mergedData.urlPresets;
|
||||
|
||||
Reference in New Issue
Block a user