Spaces:
Running
Running
Commit ·
f4d1039
1
Parent(s): 42f5e06
Fixes
Browse files- app.js +9 -8
- src/textWithBgImage/SequentialScene.tsx +0 -8
app.js
CHANGED
|
@@ -116,13 +116,14 @@ async function generateOutputBundle(jobId) {
|
|
| 116 |
return outFile
|
| 117 |
}
|
| 118 |
|
| 119 |
-
async function notify(jobId, origManu, outputUrl, status, time_taken) {
|
| 120 |
origManu.meta.render = {
|
| 121 |
output_url: outputUrl,
|
| 122 |
status: status,
|
| 123 |
time_taken: time_taken,
|
| 124 |
id: jobId
|
| 125 |
}
|
|
|
|
| 126 |
if (origManu.meta.callback_url) {
|
| 127 |
try {
|
| 128 |
let cbRes = await axios.post(origManu.meta.callback_url, origManu.meta)
|
|
@@ -173,13 +174,13 @@ app.all('/render', async (req, res) => {
|
|
| 173 |
})
|
| 174 |
const perf = new PerformanceRecorder()
|
| 175 |
perf.reset()
|
| 176 |
-
let
|
| 177 |
let skipRender = req.query.skipRender
|
| 178 |
-
let fileName = decodeURIComponent(Utils.getFileName(
|
| 179 |
let filePath = req.query.filePath || path.join(__dirname, `public/${fileName}`)
|
| 180 |
-
if (
|
| 181 |
-
console.log('Downloading remote asset bundle from',
|
| 182 |
-
await Utils.downloadFile(
|
| 183 |
console.log('Downloaded remote asset bundle', 'to', filePath)
|
| 184 |
}
|
| 185 |
if (fs.existsSync(filePath)) {
|
|
@@ -231,7 +232,7 @@ app.all('/render', async (req, res) => {
|
|
| 231 |
if (req.query.async == 1) {
|
| 232 |
cb = async (result) => {
|
| 233 |
if (result != 0) {
|
| 234 |
-
notify(jobID, manuObj, undefined, 'FAILED', perf.elapsedString())
|
| 235 |
resolver()
|
| 236 |
return
|
| 237 |
}
|
|
@@ -240,7 +241,7 @@ app.all('/render', async (req, res) => {
|
|
| 240 |
let outFile = await generateOutputBundle(jobID)
|
| 241 |
let uploadResult = await uploader.upload(outFile)
|
| 242 |
sendToObserver(jobID, uploadResult.url)
|
| 243 |
-
notify(jobID, manuObj, uploadResult.url, 'SUCCESS', perf.elapsedString())
|
| 244 |
}
|
| 245 |
res.write(JSON.stringify({
|
| 246 |
status: 'SCHEDULED',
|
|
|
|
| 116 |
return outFile
|
| 117 |
}
|
| 118 |
|
| 119 |
+
async function notify(jobId, origManu, outputUrl, bundleUrl, status, time_taken) {
|
| 120 |
origManu.meta.render = {
|
| 121 |
output_url: outputUrl,
|
| 122 |
status: status,
|
| 123 |
time_taken: time_taken,
|
| 124 |
id: jobId
|
| 125 |
}
|
| 126 |
+
origManu.bundleUrl = bundleUrl
|
| 127 |
if (origManu.meta.callback_url) {
|
| 128 |
try {
|
| 129 |
let cbRes = await axios.post(origManu.meta.callback_url, origManu.meta)
|
|
|
|
| 174 |
})
|
| 175 |
const perf = new PerformanceRecorder()
|
| 176 |
perf.reset()
|
| 177 |
+
let bundleUrl = req.query.fileUrl
|
| 178 |
let skipRender = req.query.skipRender
|
| 179 |
+
let fileName = decodeURIComponent(Utils.getFileName(bundleUrl))
|
| 180 |
let filePath = req.query.filePath || path.join(__dirname, `public/${fileName}`)
|
| 181 |
+
if (bundleUrl) {
|
| 182 |
+
console.log('Downloading remote asset bundle from', bundleUrl)
|
| 183 |
+
await Utils.downloadFile(bundleUrl, filePath, true)
|
| 184 |
console.log('Downloaded remote asset bundle', 'to', filePath)
|
| 185 |
}
|
| 186 |
if (fs.existsSync(filePath)) {
|
|
|
|
| 232 |
if (req.query.async == 1) {
|
| 233 |
cb = async (result) => {
|
| 234 |
if (result != 0) {
|
| 235 |
+
notify(jobID, manuObj, undefined, bundleUrl, 'FAILED', perf.elapsedString())
|
| 236 |
resolver()
|
| 237 |
return
|
| 238 |
}
|
|
|
|
| 241 |
let outFile = await generateOutputBundle(jobID)
|
| 242 |
let uploadResult = await uploader.upload(outFile)
|
| 243 |
sendToObserver(jobID, uploadResult.url)
|
| 244 |
+
notify(jobID, manuObj, uploadResult.url, bundleUrl, 'SUCCESS', perf.elapsedString())
|
| 245 |
}
|
| 246 |
res.write(JSON.stringify({
|
| 247 |
status: 'SCHEDULED',
|
src/textWithBgImage/SequentialScene.tsx
CHANGED
|
@@ -108,14 +108,6 @@ export const SequentialScene: React.FC = (
|
|
| 108 |
|
| 109 |
{getScene(contents[3])}
|
| 110 |
|
| 111 |
-
{getTransitionScene(contents[4])}
|
| 112 |
-
|
| 113 |
-
{getScene(contents[4])}
|
| 114 |
-
|
| 115 |
-
{getTransitionScene(contents[5])}
|
| 116 |
-
|
| 117 |
-
{getScene(contents[5])}
|
| 118 |
-
|
| 119 |
|
| 120 |
|
| 121 |
{
|
|
|
|
| 108 |
|
| 109 |
{getScene(contents[3])}
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
|
| 113 |
{
|