From: Sweidan Omar Date: Mon, 2 May 2022 09:16:11 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=384ca216997bd7a39b9b9939e7a4bb464b2297ba;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C33240 --- diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/HLSProxyStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/HLSProxyStep.java index ecb1a53b..e54a5a86 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/HLSProxyStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/HLSProxyStep.java @@ -27,10 +27,12 @@ public class HLSProxyStep extends JobStep { Path sourceFilePath = Paths.get(archiveItem.getMediaFile()); try { String fileName = sourceFilePath.getFileName().toString(); - String proxyName = fileName.substring(0, fileName.lastIndexOf(".")) + "S01" + fileName.substring(fileName.lastIndexOf(".")); - Path lowresSourcePath = Paths.get(sourceFilePath.getParent().toString(), EscortFiles.STATUSFOLDER, proxyName); + String proxyName = fileName.substring(0, fileName.lastIndexOf(".")) + "S01" + + fileName.substring(fileName.lastIndexOf(".")); + Path lowresSourcePath = Paths.get(sourceFilePath.getParent().toString(), EscortFiles.STATUSFOLDER, + proxyName); if (!lowresSourcePath.toFile().exists()) - throw new Exception("File not exists: " + lowresSourcePath); + throw new Exception("File does not exist: " + lowresSourcePath); Store lowresStore = getManager().getCurrentLowresStore(); StoreUri lowresStoreUri = lowresStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL); @@ -38,7 +40,8 @@ public class HLSProxyStep extends JobStep { Path subdirPath = null; if (proxyName.indexOf(".") > 2) { - subdirPath = Paths.get(proxyName.substring(0, 1), proxyName.substring(1, 2), proxyName.substring(2, 3), proxyName); + subdirPath = Paths.get(proxyName.substring(0, 1), proxyName.substring(1, 2), proxyName.substring(2, 3), + proxyName); } else { subdirPath = Paths.get(proxyName); } @@ -55,19 +58,22 @@ public class HLSProxyStep extends JobStep { EscortFiles.ensureUNCFolder(webPath, subDir); lowresTargetPath = Paths.get(webPath, subDir); - //Files.move(lowresSourcePath, lowresTargetPath); + // Files.move(lowresSourcePath, lowresTargetPath); - FFMpeg.hls_audio4ch(lowresSourcePath.toAbsolutePath().toString(), lowresTargetPath.toAbsolutePath().toString(), p -> { - setProgress((int) p); - }); + FFMpeg.hls_audio4ch(lowresSourcePath.toAbsolutePath().toString(), + lowresTargetPath.toAbsolutePath().toString(), p -> { + setProgress((int) p); + }); Path lowresHTTPPath = Paths.get(subDir, "index.m3u8"); - MediaFile mediaFile = getManager().createMediaFile(lowresHTTPPath.toString(), LOWRES_FILETYPE, lowresStore.getName()); + MediaFile mediaFile = getManager().createMediaFile(lowresHTTPPath.toString(), LOWRES_FILETYPE, + lowresStore.getName()); mediaFile.setMediaId(mediaCubeMedia.getId()); getManager().add(mediaFile); } catch (Exception e) { logger.catching(e); - logger.error(marker, "A HLS proxy létrehozása sikertelen a '{}' fájlból. A rendszer üzenete: {}", sourceFilePath, e.getMessage()); + logger.error(marker, "A HLS proxy létrehozása sikertelen a '{}' fájlból. A rendszer üzenete: {}", + sourceFilePath, e.getMessage()); } return null; }