From ec71dd2c503f088298bd2ab3f2bd86673ab55705 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Sat, 21 Mar 2026 23:21:07 +0100 Subject: [PATCH] feat: widen InstanceStreamingLimits.allowedResolutions to support 'native' --- packages/server/src/routes/spaces.ts | 10 +++++----- packages/shared/src/types.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/server/src/routes/spaces.ts b/packages/server/src/routes/spaces.ts index 89409d54..0e6c6c76 100644 --- a/packages/server/src/routes/spaces.ts +++ b/packages/server/src/routes/spaces.ts @@ -1016,10 +1016,10 @@ export async function spaceRoutes(app: FastifyInstance): Promise { // Check for case-insensitive duplicate name within the space const rawDb = getRawDb(); const duplicate = rawDb.prepare( - 'SELECT id FROM roles WHERE space_id = ? AND name = ? COLLATE NOCASE' + 'SELECT id FROM roles WHERE space_id = ? AND name COLLATE NOCASE = ?' ).get(id, roleName); if (duplicate) { - return reply.code(409).send({ error: 'A role with this name already exists' }); + return reply.code(409).send({ error: 'A role with this name already exists', statusCode: 409 }); } const roleId = generateSnowflake(); @@ -1061,15 +1061,15 @@ export async function spaceRoutes(app: FastifyInstance): Promise { if (name !== undefined) { const trimmed = name.trim(); if (!trimmed) { - return reply.code(400).send({ error: 'Role name cannot be empty' }); + return reply.code(400).send({ error: 'Role name cannot be empty', statusCode: 400 }); } // Check for case-insensitive duplicate name within the space const rawDb = getRawDb(); const duplicate = rawDb.prepare( - 'SELECT id FROM roles WHERE space_id = ? AND name = ? COLLATE NOCASE AND id != ?' + 'SELECT id FROM roles WHERE space_id = ? AND name COLLATE NOCASE = ? AND id != ?' ).get(id, trimmed, roleId); if (duplicate) { - return reply.code(409).send({ error: 'A role with this name already exists' }); + return reply.code(409).send({ error: 'A role with this name already exists', statusCode: 409 }); } updates.name = trimmed; } diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts index 42f1370d..52b306d6 100644 --- a/packages/shared/src/types.ts +++ b/packages/shared/src/types.ts @@ -611,7 +611,7 @@ export interface InstanceStreamingLimits { maxBitrateKbps: number; minBitrateKbps: number; bitrateStepKbps: number; - allowedResolutions: number[]; + allowedResolutions: (number | 'native')[]; allowedFramerates: number[]; maxResolution: number; maxFramerate: number;