Calculate proxy path
// Input strings
// input path needs to be json escaped (for windows only) or unix if path mapping is in place
// var hiresPath = "{path.map.to.json.{job.source}}";
// var hiresPath = "{path.map.to.unix.{job.source}}";
var hiresPath = "C:\\\\sports\\lucid-production\\Production\\01_Media\\Original_Card_Media\\2024 Card Media\\22_VEG\\Test Rushes_Card 01\\XDROOT\\Clip\\test.mxf";
// Define variables
var hiresDelimiter = "Original_Card_Media";
var proxyDelimiter = "Proxy_Card_Media";
var hiresExtension = "mxf";
var proxyExtension = "mov";
// Function to transform the hiresPath to proxyPath
function transformPath(hiresPath, hiresDelimiter, proxyDelimiter, hiresExtension, proxyExtension) {
// Replace the hiresDelimiter with proxyDelimiter
var proxyPath = hiresPath.replace(hiresDelimiter, proxyDelimiter);
// Replace the hiresExtension with proxyExtension
proxyPath = proxyPath.replace(new RegExp(hiresExtension + '$'), proxyExtension);
return proxyPath;
}
// Transform the path
var proxyPath = transformPath(hiresPath, hiresDelimiter, proxyDelimiter, hiresExtension, proxyExtension);
// Output the result
proxyPath;Last updated