From c25af4820143f63e9b73a577f1b16d11864ed737 Mon Sep 17 00:00:00 2001 From: Sweidan Omar Date: Mon, 6 Dec 2021 12:29:57 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32491 --- .../server/steps/TranscodeFFAStranStep.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFAStranStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFAStranStep.java index 87415892..99ca1744 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFAStranStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeFFAStranStep.java @@ -40,8 +40,9 @@ public class TranscodeFFAStranStep extends JobStep { private Marker marker; @StepEntry - public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, String transcoderAddress, String transcoderTemplateName, - String globalHiresSourcePath, String localLowresTargetPath, boolean deleteSource, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, String transcoderAddress, + String transcoderTemplateName, String globalHiresSourcePath, String localLowresTargetPath, + boolean deleteSource, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { this.marker = jobRuntime.getSessionMarker(); this.manager = jobEngine.getItemManager(); @@ -59,7 +60,8 @@ public class TranscodeFFAStranStep extends JobStep { String sourceFileName = sourceMediaFile.getName(); Timecode timecode = new Timecode(mediaCubeMedia.getLength(), Type.PAL); - String details = String.format("%s (%s, %d bytes)", sourceFileName, timecode.toString(), sourceMediaFile.length()); + String details = String.format("%s (%s, %d bytes)", sourceFileName, timecode.toString(), + sourceMediaFile.length()); StoreUri storeUri = store.getTargetStoreUri(RemoteStoreProtocol.LOCAL); if (storeUri == null) @@ -72,7 +74,8 @@ public class TranscodeFFAStranStep extends JobStep { String targetFileName = FilenameUtils.removeExtension(sourceFileName) + MP4EXT; targetPath = Paths.get(localLowresTargetPath, targetFileName); if (!targetPath.toFile().exists()) { - // jobRuntime.setDescription(String.format("%s: %s", jobRuntime.getDescription(), details)); + // jobRuntime.setDescription(String.format("%s: %s", + // jobRuntime.getDescription(), details)); jobRuntime.setDescription(String.format("%s transzkódolása", details)); String sourceFile = Paths.get(globalHiresSourcePath, sourceFileName).toString(); IFFAStransAPI api = new FFAStransAPI(transcoderAddress, p -> { @@ -84,11 +87,11 @@ public class TranscodeFFAStranStep extends JobStep { api.monitor(POLL_INTERVALL); } - //a sikeres transzkod utan nem mindig van ott egybol a fajl + // a sikeres transzkod utan nem mindig van ott egybol a fajl long started = System.currentTimeMillis(); while (!targetPath.toFile().exists()) { long current = System.currentTimeMillis(); - //max 5 perc varakozas + // max 5 perc varakozas if (current - started > 5 * 60 * 1000) throw new Exception("Transcode job target file access timed out"); Thread.sleep(POLL_INTERVALL); @@ -124,7 +127,8 @@ public class TranscodeFFAStranStep extends JobStep { String transcodedFileName = transcodedFilePath.getFileName().toString(); String targetPath = null; if (transcodedFileName.indexOf(".") > 2) { - Path subdir = Paths.get(transcodedFileName.substring(0, 1), transcodedFileName.substring(1, 2), transcodedFileName.substring(2, 3)); + Path subdir = Paths.get(transcodedFileName.substring(0, 1), transcodedFileName.substring(1, 2), + transcodedFileName.substring(2, 3)); EscortFiles.ensureUNCFolder(webPath, subdir.toString()); targetPath = Paths.get(subdir.toString(), transcodedFileName).toString(); } else { @@ -144,7 +148,8 @@ public class TranscodeFFAStranStep extends JobStep { manager.createMediaFile(targetPath, fileType, store, mediaCubeMedia).add(); } catch (IOException e) { logger.catching(e); - logger.error(marker, "A '{}' állomány mozgatása a '{}' helyre nem sikerült.", transcodedFilePath, lowresPath); + logger.error(marker, "A(z) '{}' állomány mozgatása a '{}' helyre nem sikerült.", transcodedFilePath, + lowresPath); throw e; } } -- 2.54.0