\r
import com.ibm.nosql.json.api.BasicDBObject;\r
\r
+import user.commons.configuration.SystemConfiguration;\r
+\r
public class PrepareRemoteTranscodeStep extends JobStep {\r
static private final Logger logger = LogManager.getLogger();\r
+ private static boolean RANDOMIZE_ARCHIVES = SystemConfiguration.getInstance().value("tsm.randomize-archives",\r
+ false);\r
\r
@StepEntry\r
public Object[] execute(String profileName, String fileName) throws Exception {\r
\r
Path inputPath = Paths.get(hiResRoot, fileName);\r
\r
- String outFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".mp4";\r
+ String realFileName = fileName;\r
+\r
+ if (RANDOMIZE_ARCHIVES)\r
+ realFileName = realFileName.substring(9);\r
+\r
+ String outFileName = realFileName.substring(0, realFileName.lastIndexOf(".")) + ".mp4";\r
\r
Path relativeOutputPath = null;\r
- if (fileName.length() > 2)\r
- relativeOutputPath = Paths.get(fileName.substring(0, 1), fileName.substring(1, 2), fileName.substring(2, 3), outFileName);\r
+ if (realFileName.length() > 2)\r
+ relativeOutputPath = Paths.get(realFileName.substring(0, 1), realFileName.substring(1, 2),\r
+ realFileName.substring(2, 3), outFileName);\r
else\r
- relativeOutputPath = Paths.get(fileName, outFileName);\r
+ relativeOutputPath = Paths.get("0", outFileName);\r
\r
BasicDBObject parameters = new BasicDBObject();\r
parameters.put("profile", profileName);\r