Require distinct panorama locations for rounds and captures
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 6m30s

This commit is contained in:
2026-10-16 10:09:36 +05:00
parent c9fc9496eb
commit 1a34eb71c2
16 changed files with 367 additions and 3 deletions

View File

@@ -21,6 +21,13 @@ export const pointSchema = z.object({
z: z.number().finite(),
});
export const faces = ["px", "nx", "py", "ny", "pz", "nz"] as const;
export function panoramaLocationKey(point: {
x: number;
y: number;
z: number;
}) {
return [point.x, point.y, point.z].map(Math.floor).join(",");
}
export const viewpointSchema = pointSchema.extend({
id: z.string().regex(/^[a-zA-Z0-9_-]{1,64}$/),
assetRoot: z.string().uuid().optional(),
@@ -144,6 +151,11 @@ export const datasetSchema = z
// Media provenance is assigned by the server after the owner accepts a contribution.
export function parseUploadManifest(value: unknown) {
const manifest = datasetSchema.parse(value);
if (
!manifest.contributionTo &&
new Set(manifest.viewpoints.map(panoramaLocationKey)).size < 5
)
throw new Error("Capture at least five panoramas from different block positions");
if (manifest.mediaFormat)
throw new Error("Use map import for rendered archives");
manifest.serverAddress =