The swiss army knife of lossless video/audio editing
start at 1 instead of 0 #2296
Mikael Finstad25021546f453
diff --git a/import-export.md b/import-export.mdindex 5bfabb8d..81dafb0e 100644--- a/import-export.md+++ b/import-export.md@@ -11,8 +11,8 @@ The following variables are available in the template to customize the filenames| ✅ | `${FILENAME}` | `string` | The original filename *without the extension* (e.g. `Beach Trip` for a file named `Beach Trip.mp4`).| ✅ | `${EXT}` | `string` | The extension of the file (e.g.: `.mp4`, `.mkv`).| ✅ | `${EPOCH_MS}` | `number` | Number of milliseconds since epoch (e.g. `1680852771465`). Useful to generate a unique file name on every export to prevent accidental overwrite.-| ✅ | `${EXPORT_COUNT}` | `number` | Number of exports done since last LosslessCut launch (starts at 0).-| | `${FILE_EXPORT_COUNT}` | `number` | Number of exports done since last file was opened (starts at 0).+| ✅ | `${EXPORT_COUNT}` | `number` | Number of exports done since last LosslessCut launch (starts at 1).+| | `${FILE_EXPORT_COUNT}` | `number` | Number of exports done since last file was opened (starts at 1).| | `${SEG_NUM}` | `string` | Segment index, padded string (e.g. `01`, `02` or `42`).| | `${SEG_NUM_INT}` | `number` | Segment index, as an integer (e.g. `1`, `2` or `42`). Can be used with numeric arithmetics, e.g. `${SEG_NUM_INT+100}`.| | `${SEG_LABEL}` | `string` | The label of the segment (e.g. `Getting Lunch`).diff --git a/src/renderer/src/util/outputNameTemplate.ts b/src/renderer/src/util/outputNameTemplate.tsindex 95da4203..8fd4170e 100644--- a/src/renderer/src/util/outputNameTemplate.ts+++ b/src/renderer/src/util/outputNameTemplate.ts@@ -141,8 +141,8 @@ async function interpolateOutFileName(template: string, { epochMs, inputFileName...tags,...Object.fromEntries(Object.entries(tags).map(([key, value]) => [`${key.toLocaleUpperCase('en-US')}`, value])),},- FILE_EXPORT_COUNT: currentFileExportCount,- EXPORT_COUNT: exportCount,+ FILE_EXPORT_COUNT: currentFileExportCount != null ? currentFileExportCount + 1 : undefined,+ EXPORT_COUNT: exportCount != null ? exportCount + 1 : undefined,};const ret = (await safeishEval(`\`${template}\``, context));