@nexrender/core 1.63.1 → 1.63.3
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.
- package/package.json +2 -2
- package/src/tasks/download.js +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexrender/core",
|
|
3
|
-
"version": "1.63.
|
|
3
|
+
"version": "1.63.3",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"author": "Inlife",
|
|
6
6
|
"homepage": "https://www.nexrender.com",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "6aa3b6453eb929a4e4c4a802d38f57be5078c6e3"
|
|
49
49
|
}
|
package/src/tasks/download.js
CHANGED
|
@@ -33,7 +33,8 @@ const download = (job, settings, asset) => {
|
|
|
33
33
|
if (protocol === 'data' && !asset.layerName) {
|
|
34
34
|
destName = Math.random().toString(36).substring(2);
|
|
35
35
|
} else {
|
|
36
|
-
|
|
36
|
+
// Use uri.pathname to avoid issues with forward slashes in query parameters (e.g., Adobe Scene7 URLs)
|
|
37
|
+
destName = uri.pathname || path.basename(asset.src)
|
|
37
38
|
destName = destName.indexOf('?') !== -1 ? destName.slice(0, destName.indexOf('?')) : destName;
|
|
38
39
|
/* ^ remove possible query search string params ^ */
|
|
39
40
|
destName = decodeURI(destName) /* < remove/decode any special URI symbols within filename */
|
|
@@ -59,6 +60,19 @@ const download = (job, settings, asset) => {
|
|
|
59
60
|
destName += '.' + asset.extension
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
/* Truncate filename if too long to avoid Windows MAX_PATH (260 chars) issues */
|
|
64
|
+
if (process.platform === 'win32') {
|
|
65
|
+
const maxFilenameLength = 50; // Conservative limit to account for long base paths
|
|
66
|
+
if (destName.length > maxFilenameLength) {
|
|
67
|
+
const ext = path.extname(destName);
|
|
68
|
+
const baseName = path.basename(destName, ext);
|
|
69
|
+
const randomSuffix = Math.random().toString(36).substring(2, 10); // 8 chars
|
|
70
|
+
const truncatedBase = baseName.substring(0, maxFilenameLength - ext.length - randomSuffix.length - 1);
|
|
71
|
+
destName = `${truncatedBase}-${randomSuffix}${ext}`;
|
|
72
|
+
settings.logger.log(`[${job.uid}] Truncated long filename to: ${destName}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
62
76
|
asset.dest = path.join(job.workpath, destName);
|
|
63
77
|
|
|
64
78
|
settings.trackCombined('Asset Download', {
|