Merge branch 'master' into crapblox

This commit is contained in:
I-Have-An-Issue 2023-02-17 20:55:54 -05:00
commit 6a2130f17e
No known key found for this signature in database
GPG Key ID: E55435DEA0825091
1 changed files with 19 additions and 19 deletions

View File

@ -1,32 +1,32 @@
const express = require("express");
const app = express.Router();
const express = require("express")
const app = express.Router()
const RenderJob = require("../../lib/classes/RenderJob.js");
const RenderJob = require("../../lib/classes/RenderJob.js")
app.get("/:id", async (request, response) => {
const { params, query } = request;
const job = new RenderJob();
let body = {};
const { params, query } = request
const job = new RenderJob()
let body = {}
const aseet = await job.RenderAsset(params.id).catch((_) => _);
if (aseet?.message) {
job.Stop();
return response.status(500).json({ error: aseet.message });
const asset = await job.RenderAsset(params.id).catch((_) => _)
if (asset?.message) {
job.Stop()
return response.status(500).json({ error: asset.message })
}
body.aseet = aseet;
body.asset = asset
if (query.three_d) {
const three_d = await job.RenderAsset(params.id, true).catch((_) => _);
const three_d = await job.RenderAsset(params.id, true).catch((_) => _)
if (three_d?.message) {
job.Stop();
return response.status(500).json({ error: three_d.message });
job.Stop()
return response.status(500).json({ error: three_d.message })
}
body.three_d = three_d;
body.three_d = three_d
}
job.Stop();
job.Stop()
return response.json(body);
});
return response.json(body)
})
module.exports = app;
module.exports = app