git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Mon, 2 May 2022 09:16:11 +0000 (09:16 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Mon, 2 May 2022 09:16:11 +0000 (09:16 +0000)
server/user.jobengine.executors/src/user/jobengine/server/steps/HLSProxyStep.java

index ecb1a53b3008d28abf274fe7f104362804875d68..e54a5a8691374a00ba86a2dd5132b44a558dca80 100644 (file)
@@ -27,10 +27,12 @@ public class HLSProxyStep extends JobStep {
                Path sourceFilePath = Paths.get(archiveItem.getMediaFile());\r
                try {\r
                        String fileName = sourceFilePath.getFileName().toString();\r
-                       String proxyName = fileName.substring(0, fileName.lastIndexOf(".")) + "S01" + fileName.substring(fileName.lastIndexOf("."));\r
-                       Path lowresSourcePath = Paths.get(sourceFilePath.getParent().toString(), EscortFiles.STATUSFOLDER, proxyName);\r
+                       String proxyName = fileName.substring(0, fileName.lastIndexOf(".")) + "S01"\r
+                                       + fileName.substring(fileName.lastIndexOf("."));\r
+                       Path lowresSourcePath = Paths.get(sourceFilePath.getParent().toString(), EscortFiles.STATUSFOLDER,\r
+                                       proxyName);\r
                        if (!lowresSourcePath.toFile().exists())\r
-                               throw new Exception("File not exists: " + lowresSourcePath);\r
+                               throw new Exception("File does not exist: " + lowresSourcePath);\r
 \r
                        Store lowresStore = getManager().getCurrentLowresStore();\r
                        StoreUri lowresStoreUri = lowresStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL);\r
@@ -38,7 +40,8 @@ public class HLSProxyStep extends JobStep {
 \r
                        Path subdirPath = null;\r
                        if (proxyName.indexOf(".") > 2) {\r
-                               subdirPath = Paths.get(proxyName.substring(0, 1), proxyName.substring(1, 2), proxyName.substring(2, 3), proxyName);\r
+                               subdirPath = Paths.get(proxyName.substring(0, 1), proxyName.substring(1, 2), proxyName.substring(2, 3),\r
+                                               proxyName);\r
                        } else {\r
                                subdirPath = Paths.get(proxyName);\r
                        }\r
@@ -55,19 +58,22 @@ public class HLSProxyStep extends JobStep {
 \r
                        EscortFiles.ensureUNCFolder(webPath, subDir);\r
                        lowresTargetPath = Paths.get(webPath, subDir);\r
-                       //Files.move(lowresSourcePath, lowresTargetPath);\r
+                       // Files.move(lowresSourcePath, lowresTargetPath);\r
 \r
-                       FFMpeg.hls_audio4ch(lowresSourcePath.toAbsolutePath().toString(), lowresTargetPath.toAbsolutePath().toString(), p -> {\r
-                               setProgress((int) p);\r
-                       });\r
+                       FFMpeg.hls_audio4ch(lowresSourcePath.toAbsolutePath().toString(),\r
+                                       lowresTargetPath.toAbsolutePath().toString(), p -> {\r
+                                               setProgress((int) p);\r
+                                       });\r
 \r
                        Path lowresHTTPPath = Paths.get(subDir, "index.m3u8");\r
-                       MediaFile mediaFile = getManager().createMediaFile(lowresHTTPPath.toString(), LOWRES_FILETYPE, lowresStore.getName());\r
+                       MediaFile mediaFile = getManager().createMediaFile(lowresHTTPPath.toString(), LOWRES_FILETYPE,\r
+                                       lowresStore.getName());\r
                        mediaFile.setMediaId(mediaCubeMedia.getId());\r
                        getManager().add(mediaFile);\r
                } catch (Exception e) {\r
                        logger.catching(e);\r
-                       logger.error(marker, "A HLS proxy létrehozása sikertelen a '{}' fájlból. A rendszer üzenete: {}", sourceFilePath, e.getMessage());\r
+                       logger.error(marker, "A HLS proxy létrehozása sikertelen a '{}' fájlból. A rendszer üzenete: {}",\r
+                                       sourceFilePath, e.getMessage());\r
                }\r
                return null;\r
        }\r