0.9.1-2 Metadata Fix
This commit is contained in:
4
backend/package-lock.json
generated
4
backend/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ripster-backend",
|
||||
"version": "0.9.1-1",
|
||||
"version": "0.9.1-2",
|
||||
"private": true,
|
||||
"type": "commonjs",
|
||||
"scripts": {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user