fix(connector): try every matching path mapping, not just the first
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:
twotalesanimation
2026-08-13 19:20:14 +02:00
parent c4a85bac2b
commit 4929db45a2
2 changed files with 28 additions and 8 deletions
+10 -5
View File
@@ -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" });
+18 -3
View File
@@ -36,9 +36,24 @@ It resolves this itself in most cases, trying in order:
from the show folder down (`{root}/{showId}/{episode}/{shot}/{version}`), so
the tail is simply re-attached to Export Root.
Step 3 is why this usually needs no configuration. Set Path Mappings only when
the two layouts genuinely differ. **Diagnostics** checks this against a real
render folder from the QC queue and names every path it tried when it fails.
Step 3 is why this usually needs no configuration. **Diagnostics** checks the
whole thing against a real render folder from the QC queue and names every path
it tried when it fails.
### More than one on-disk convention
Every candidate is tested for existence and the first that resolves wins, so a
studio whose output root changed at some point can map the **same prefix more
than once** and let the panel work out which applies per export:
```
//SAN/=V:/_EXPORTS/;//SAN/=V:/_EXPORTS/UNG/
```
Older exports keep whatever path was stored on them when they were queued —
changing `render.outputRoot` on the server only affects new ones — so mixed
conventions in one database are normal and permanent. Add a mapping per
convention rather than trying to make one rewrite cover them all.
---