@nexrender/core 1.41.0 → 1.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/tasks/render.js +18 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexrender/core",
3
- "version": "1.41.0",
3
+ "version": "1.41.1",
4
4
  "main": "src/index.js",
5
5
  "author": "Inlife",
6
6
  "scripts": {
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "01e3428a9194eb50e40f22a66bb236c9fc70a03c"
33
+ "gitHead": "f7cbfd9d2a20c145547c30e16176e2fcb97a8813"
34
34
  }
@@ -205,19 +205,26 @@ module.exports = (job, settings) => {
205
205
  // the outputfile appears to be forced as .mov.
206
206
  // We need to maintain this here while we have 2022 and 2020
207
207
  // workers simultaneously
208
- const movOutputFile = outputFile.replace(/\.avi$/g, '.mov')
209
- const existsMovOutputFile = fs.existsSync(movOutputFile)
210
- if (existsMovOutputFile) {
211
- job.output = movOutputFile
212
- } else {
213
- // AE 2023 use mp4 output files
214
- const mp4OutputFile = outputFile.replace(/\.avi$/g, '.mp4')
215
- const existsMp4OutputFile = fs.existsSync(mp4OutputFile)
216
- if (existsMp4OutputFile) {
217
- job.output = mp4OutputFile
218
- }
208
+
209
+ const defaultOutputs = [
210
+ job.output,
211
+ job.output.replace(/\.avi$/g, '.mov'),
212
+ job.output.replace(/\.avi$/g, '.mp4'),
213
+ job.output.replace(/\.mov$/g, '.avi'),
214
+ job.output.replace(/\.mov$/g, '.mp4'),
215
+ ]
216
+
217
+ while (!fs.existsSync(defaultOutputs[0]) && defaultOutputs.length > 0) {
218
+ defaultOutputs.shift();
219
219
  }
220
220
 
221
+ if (defaultOutputs.length === 0) {
222
+ clearTimeout(timeoutID);
223
+ return reject(new Error(`Output file not found: ${job.output}`));
224
+ }
225
+
226
+ job.output = defaultOutputs[0];
227
+
221
228
  if (!fs.existsSync(job.output)) {
222
229
  if (fs.existsSync(logPath)) {
223
230
  settings.logger.log(`[${job.uid}] dumping aerender log:`)