fix(connector): try every matching path mapping, not just the first
Deploy / deploy (push) Successful in 6m5s
Deploy / deploy (push) Successful in 6m5s
A studio whose render output root changed carries both conventions in the
database permanently — changing render.outputRoot only affects new
exports, so old rows keep the path they were queued with. On UNG that is
//SAN/renders/{projectCode}/... for older exports and //SAN/{showId}/...
for current ones, living side by side under one Export Root.
applyPathMappings returned only the first prefix match, so one rewrite
had to serve both and could not. It now returns every match and
resolveServerPath tests each for existence, which is what the candidate
ordering was there for.
Verified against the live drive: with "//SAN/=V:/_EXPORTS/UNG/" the
legacy export resolves via the mapping and current ones via the Export
Root re-base; with both rewrites mapped, all three resolve directly.
Panel 2.1.1.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+10
-5
@@ -27,7 +27,7 @@ var SETTINGS_KEY = "cfg";
|
||||
// Bump on every change deployed to a workstation. The panel reports this to
|
||||
// the server on load, so Pipeline → Machines shows which version each machine
|
||||
// is actually running and flags the ones left behind.
|
||||
var PANEL_VERSION = "2.1.0";
|
||||
var PANEL_VERSION = "2.1.1";
|
||||
|
||||
(function VFXReviewConnector(thisObj) {
|
||||
var uiState = {
|
||||
@@ -828,17 +828,22 @@ var PANEL_VERSION = "2.1.0";
|
||||
return mappings;
|
||||
}
|
||||
|
||||
// Returns *every* rewrite whose prefix matches, not just the first: a shop
|
||||
// with more than one on-disk convention (an old export root and a current
|
||||
// one) can map the same prefix twice, and resolveServerPath picks whichever
|
||||
// candidate actually exists.
|
||||
function applyPathMappings(path) {
|
||||
var mappings = parsePathMappings();
|
||||
var normalized = normalizeSlashes(path);
|
||||
var results = [];
|
||||
var i;
|
||||
|
||||
for (i = 0; i < mappings.length; i += 1) {
|
||||
if (normalized.toLowerCase().indexOf(mappings[i].from.toLowerCase()) === 0) {
|
||||
return mappings[i].to + normalized.substring(mappings[i].from.length);
|
||||
results.push(mappings[i].to + normalized.substring(mappings[i].from.length));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return results;
|
||||
}
|
||||
|
||||
// Re-base a server path onto Export Root from the show folder down, which
|
||||
@@ -874,8 +879,8 @@ var PANEL_VERSION = "2.1.0";
|
||||
var rebased;
|
||||
var i;
|
||||
|
||||
if (mapped) {
|
||||
candidates.push({ path: mapped, how: "path mapping" });
|
||||
for (i = 0; i < mapped.length; i += 1) {
|
||||
candidates.push({ path: mapped[i], how: "path mapping" });
|
||||
}
|
||||
candidates.push({ path: normalizeSlashes(serverPath), how: "server path" });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user