diff --git a/Run-AutoRender.bat b/Run-AutoRender.bat deleted file mode 100644 index 3216b09..0000000 --- a/Run-AutoRender.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -cd /d "%~dp0" -echo Starte zyklischen Viz Auto-Render Check... -node worker.mjs diff --git a/Run-AutoRender.ps1 b/Run-AutoRender.ps1 new file mode 100644 index 0000000..53a56e9 --- /dev/null +++ b/Run-AutoRender.ps1 @@ -0,0 +1,4 @@ +$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +Set-Location -Path $ScriptDir +Write-Host "Starte zyklischen Viz Auto-Render Check..." -ForegroundColor Cyan +node worker.mjs diff --git a/worker.mjs b/worker.mjs index 27856e0..f55d1d7 100644 --- a/worker.mjs +++ b/worker.mjs @@ -37,11 +37,15 @@ async function main() { // Zieldateiname bestimmen const targetFormat = job.format === 'prores4444' ? 'prores' : (job.format || 'prores'); const outExt = (targetFormat === 'prores' || targetFormat === 'qtrle') ? '.mov' : (targetFormat === 'webm_alpha' ? '.webm' : '.mp4'); - const finalTitle = job.title ? job.title.replace(/[^a-zA-Z0-9_-]/g, '_') : 'Output'; - const expectedVideoPath = path.join(vizDir, `${finalTitle}${outExt}`); + + // Prüfen, ob bereits irgendeine Datei mit dieser Endung (z.B. .mov) im Ordner liegt + const hasVideoAlready = files.some(f => f.toLowerCase().endsWith(outExt)); - // Job nur vormerken, wenn das Video noch NICHT existiert - if (!fs.existsSync(expectedVideoPath)) { + // Job nur vormerken, wenn NOCH KEIN solches Video existiert + if (!hasVideoAlready) { + // Wir definieren dennoch einen finalen Dateinamen für den neuen Render + const finalTitle = job.title ? job.title.replace(/[^a-zA-Z0-9_-]/g, '_') : 'Output'; + const expectedVideoPath = path.join(vizDir, `${finalTitle}${outExt}`); pendingJobs.push({ jsonPath, job, expectedVideoPath, targetFormat }); } } catch (e) {