0.9.1-2 Metadata Fix

This commit is contained in:
2026-03-14 09:32:13 +00:00
parent 241b097ea9
commit 59bcb54492
9 changed files with 57 additions and 13 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "ripster-backend",
"version": "0.9.1-1",
"version": "0.9.1-2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ripster-backend",
"version": "0.9.1-1",
"version": "0.9.1-2",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.4.7",

View File

@@ -1,6 +1,6 @@
{
"name": "ripster-backend",
"version": "0.9.1-1",
"version": "0.9.1-2",
"private": true,
"type": "commonjs",
"scripts": {

View File

@@ -641,11 +641,23 @@ function buildRawPathForJobId(rawPath, jobId) {
const absRawPath = normalizeComparablePath(rawPath);
const folderName = path.basename(absRawPath);
// Replace existing job ID suffix if present
const replaced = folderName.replace(/(\s-\sRAW\s-\sjob-)\d+\s*$/i, `$1${Math.trunc(normalizedJobId)}`);
if (replaced === folderName) {
return absRawPath;
if (replaced !== folderName) {
return path.join(path.dirname(absRawPath), replaced);
}
return path.join(path.dirname(absRawPath), replaced);
// No existing job ID suffix — add canonical suffix
// Strip any state prefix (Rip_Complete_ / Incomplete_), append suffix, restore prefix
const statePrefix = /^Rip_Complete_/i.test(folderName)
? RAW_RIP_COMPLETE_PREFIX
: /^Incomplete_/i.test(folderName)
? RAW_INCOMPLETE_PREFIX
: '';
const stripped = stripRawFolderStatePrefix(folderName);
const withJobId = `${statePrefix}${stripped} - RAW - job-${Math.trunc(normalizedJobId)}`;
return path.join(path.dirname(absRawPath), withJobId);
}
function deleteFilesRecursively(rootPath, keepRoot = true) {