diff --git a/src/schema/api.graphql b/src/schema/api.graphql index bf93890d..2d14915a 100644 --- a/src/schema/api.graphql +++ b/src/schema/api.graphql @@ -57,6 +57,7 @@ type AddSnapshotPayload { input AddStreamInput { deviceName: String! streamName: String! + streamParameters: String } type AddStreamPayload { diff --git a/src/schema/nexus-typegen.ts b/src/schema/nexus-typegen.ts index 7802501b..79e98c31 100644 --- a/src/schema/nexus-typegen.ts +++ b/src/schema/nexus-typegen.ts @@ -68,6 +68,7 @@ export interface NexusGenInputs { // input type deviceName: string; // String! streamName: string; // String! + streamParameters?: string | null; // String }; AddZoneInput: { // input type diff --git a/src/schema/stream.ts b/src/schema/stream.ts index bcc641a1..be2d862a 100644 --- a/src/schema/stream.ts +++ b/src/schema/stream.ts @@ -115,6 +115,7 @@ export const AddStreamInput = inputObjectType({ definition: (t) => { t.nonNull.string('streamName'); t.nonNull.string('deviceName'); + t.string('streamParameters'); }, }); @@ -139,6 +140,7 @@ export const AddStreamMutation = extendType({ data: { deviceName: input.deviceName, streamName: input.streamName, + streamParameters: input.streamParameters != null ? JSON.parse(input.streamParameters) : undefined, tenantId, }, }); @@ -180,13 +182,13 @@ export const ActivateStreamMutation = extendType({ const { streamName, deviceName, streamParameters, device } = stream; const uniconfigStreamName = getUniconfigStreamName(streamName, deviceName); // TODO: create column stream params - const installDeviceParams = prepareInstallParameters( + const installStreamParams = prepareInstallParameters( uniconfigStreamName, getMountParamsForStream(device.mountParameters, streamParameters), ); const uniconfigURL = await getUniconfigURL(prisma, device.uniconfigZoneId); - await installDeviceCache({ uniconfigURL, deviceName: uniconfigStreamName, params: installDeviceParams }); + await installDeviceCache({ uniconfigURL, deviceName: uniconfigStreamName, params: installStreamParams }); return { stream }; },