git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Mon, 6 Dec 2021 12:29:57 +0000 (12:29 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Mon, 6 Dec 2021 12:29:57 +0000 (12:29 +0000)
server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFAStranStep.java

index 87415892ab98e5db413fa9974860fefd7758035c..99ca174402d5ca689e53372ccfbe940544c050e1 100644 (file)
@@ -40,8 +40,9 @@ public class TranscodeFFAStranStep extends JobStep {
        private Marker marker;\r
 \r
        @StepEntry\r
-       public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, String transcoderAddress, String transcoderTemplateName,\r
-                       String globalHiresSourcePath, String localLowresTargetPath, boolean deleteSource, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+       public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, String transcoderAddress,\r
+                       String transcoderTemplateName, String globalHiresSourcePath, String localLowresTargetPath,\r
+                       boolean deleteSource, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
 \r
                this.marker = jobRuntime.getSessionMarker();\r
                this.manager = jobEngine.getItemManager();\r
@@ -59,7 +60,8 @@ public class TranscodeFFAStranStep extends JobStep {
                String sourceFileName = sourceMediaFile.getName();\r
                Timecode timecode = new Timecode(mediaCubeMedia.getLength(), Type.PAL);\r
 \r
-               String details = String.format("%s (%s, %d bytes)", sourceFileName, timecode.toString(), sourceMediaFile.length());\r
+               String details = String.format("%s (%s, %d bytes)", sourceFileName, timecode.toString(),\r
+                               sourceMediaFile.length());\r
 \r
                StoreUri storeUri = store.getTargetStoreUri(RemoteStoreProtocol.LOCAL);\r
                if (storeUri == null)\r
@@ -72,7 +74,8 @@ public class TranscodeFFAStranStep extends JobStep {
                        String targetFileName = FilenameUtils.removeExtension(sourceFileName) + MP4EXT;\r
                        targetPath = Paths.get(localLowresTargetPath, targetFileName);\r
                        if (!targetPath.toFile().exists()) {\r
-                               //                              jobRuntime.setDescription(String.format("%s: %s", jobRuntime.getDescription(), details));\r
+                               // jobRuntime.setDescription(String.format("%s: %s",\r
+                               // jobRuntime.getDescription(), details));\r
                                jobRuntime.setDescription(String.format("%s transzkódolása", details));\r
                                String sourceFile = Paths.get(globalHiresSourcePath, sourceFileName).toString();\r
                                IFFAStransAPI api = new FFAStransAPI(transcoderAddress, p -> {\r
@@ -84,11 +87,11 @@ public class TranscodeFFAStranStep extends JobStep {
                                api.monitor(POLL_INTERVALL);\r
                        }\r
 \r
-                       //a sikeres transzkod utan nem mindig van ott egybol a fajl\r
+                       // a sikeres transzkod utan nem mindig van ott egybol a fajl\r
                        long started = System.currentTimeMillis();\r
                        while (!targetPath.toFile().exists()) {\r
                                long current = System.currentTimeMillis();\r
-                               //max 5 perc varakozas\r
+                               // max 5 perc varakozas\r
                                if (current - started > 5 * 60 * 1000)\r
                                        throw new Exception("Transcode job target file access timed out");\r
                                Thread.sleep(POLL_INTERVALL);\r
@@ -124,7 +127,8 @@ public class TranscodeFFAStranStep extends JobStep {
                        String transcodedFileName = transcodedFilePath.getFileName().toString();\r
                        String targetPath = null;\r
                        if (transcodedFileName.indexOf(".") > 2) {\r
-                               Path subdir = Paths.get(transcodedFileName.substring(0, 1), transcodedFileName.substring(1, 2), transcodedFileName.substring(2, 3));\r
+                               Path subdir = Paths.get(transcodedFileName.substring(0, 1), transcodedFileName.substring(1, 2),\r
+                                               transcodedFileName.substring(2, 3));\r
                                EscortFiles.ensureUNCFolder(webPath, subdir.toString());\r
                                targetPath = Paths.get(subdir.toString(), transcodedFileName).toString();\r
                        } else {\r
@@ -144,7 +148,8 @@ public class TranscodeFFAStranStep extends JobStep {
                        manager.createMediaFile(targetPath, fileType, store, mediaCubeMedia).add();\r
                } catch (IOException e) {\r
                        logger.catching(e);\r
-                       logger.error(marker, "A '{}' állomány mozgatása a '{}' helyre nem sikerült.", transcodedFilePath, lowresPath);\r
+                       logger.error(marker, "A(z) '{}' állomány mozgatása a '{}' helyre nem sikerült.", transcodedFilePath,\r
+                                       lowresPath);\r
                        throw e;\r
                }\r
        }\r