Update index.ts

This commit is contained in:
2025-10-27 14:12:11 +08:00
parent 18236bf933
commit cbcea2719a
+5
View File
@@ -144,6 +144,11 @@ export const app = new Elysia()
const id = Math.random().toString().substring(2, 10)
let metadata = await getMetadata()
// Check duplicate owner key
if (metadata.find((p) => p.owner_key === owner_key)) {
done(400, "Owner key already in use. Please use a unique owner key.")
}
// Process and save files
// We use {id}-1 and {id}-2 as requested by "{id}-{number}"
const originalExt = photo.name.split(".").pop() || "jpg"