From 2f9fb2be756a620dd994c00983a58a13ba3b170c Mon Sep 17 00:00:00 2001 From: Sweidan Omar Date: Mon, 10 Jan 2022 14:56:34 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32711 --- .../server/steps/NEXIOArchiveCheckerStep.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java index fbd88ba3..41da571a 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java @@ -28,10 +28,11 @@ public class NEXIOArchiveCheckerStep extends JobStep { private static final Logger logger = LogManager.getLogger(); private SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd-HHmmss"); - private boolean check(Timestamp modified, Timestamp created, int duration, Media media, int videoFormat, int lastModifiedHours) { + private boolean check(Timestamp modified, Timestamp created, int duration, Media media, int videoFormat, + int lastModifiedHours) { String title = media.getTitle(); - //formatum + // formatum if (!(videoFormat == 3 || videoFormat == 19)) { logger.debug(getMarker(), "{} unsupported video format", videoFormat); return false; @@ -40,7 +41,7 @@ public class NEXIOArchiveCheckerStep extends JobStep { if (!checkModifiedByTime(title, modified, lastModifiedHours)) return false; - //utolso modositas + // utolso modositas MediaFile mediaFile = getManager().getSystemMediaFile(media); boolean isModified = true; if (mediaFile == null) { @@ -66,11 +67,12 @@ public class NEXIOArchiveCheckerStep extends JobStep { } private boolean checkModifiedByTime(String title, Timestamp modified, int lastModifiedHours) { - //utolso modositas a mosthoz kepest - //The result of this method can be a negative period if the end is before the start. + // utolso modositas a mosthoz kepest + // The result of this method can be a negative period if the end is before the + // start. long modifiedHours = Duration.between(modified.toInstant(), Instant.now()).toHours(); if (modifiedHours < 0) { - logger.info(getMarker(), "{} modification time greather than now", title); + logger.info(getMarker(), "{} modification time greater than now", title); return false; } if (modifiedHours < lastModifiedHours) { @@ -118,8 +120,8 @@ public class NEXIOArchiveCheckerStep extends JobStep { return null; } - private void processClips(String storeName, StoreUri sourceStoreUri, StoreUri targetStoreUri, String outputPath, Iterator clips, - int lastModifiedHours) throws ClipNotFoundException, IOException, ProtocolException { + private void processClips(String storeName, StoreUri sourceStoreUri, StoreUri targetStoreUri, String outputPath, + Iterator clips, int lastModifiedHours) throws ClipNotFoundException, IOException, ProtocolException { int processed = 0; while (clips.hasNext()) { @@ -138,7 +140,7 @@ public class NEXIOArchiveCheckerStep extends JobStep { int videoFormat = 0; frames = clip.getDuration(); - //ures clip + // ures clip if (frames == 1) continue; @@ -164,10 +166,11 @@ public class NEXIOArchiveCheckerStep extends JobStep { if (createEscort && !title.contains("*")) { String fileName = title + DOT_MXF; - DownloadableMedia downloadable = DownloadableMedia.create(title, fileName, modified, created, frames, 0, sourceStoreUri.getId(), - targetStoreUri.getId(), mediaId); + DownloadableMedia downloadable = DownloadableMedia.create(title, fileName, modified, created, + frames, 0, sourceStoreUri.getId(), targetStoreUri.getId(), mediaId); String escortFileName = storeName + "." + downloadable.getString("fileName"); - if (EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, downloadable.toPrettyString(""))) { + if (EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, + downloadable.toPrettyString(""))) { logger.info(getMarker(), "Archive status file created for {}", fileName); } else { logger.info(getMarker(), "Archive status file already exists for {}", fileName); @@ -184,5 +187,4 @@ public class NEXIOArchiveCheckerStep extends JobStep { } } } - } -- 2.54.0