From: Vásáry Dániel Date: Fri, 4 Sep 2020 22:06:37 +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=c047853254d768b6ca6a8e675441468e1ac17725;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31951 --- diff --git a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java index a8d2a1e9..622fd8dc 100644 --- a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java +++ b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java @@ -274,4 +274,11 @@ public class SmallTests { System.out.println(p1.toFile().exists()); System.out.println(Files.isSymbolicLink(p1)); } + + @Test + public void test93() throws Exception { + String mc = "2020-09-02T07:54:31.659+0200"; + String mexio = "2020-09-03T17:52:59.098+0200"; + System.out.println(mc.compareTo(mexio)); + } } 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 895be243..c4a97867 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 @@ -30,39 +30,43 @@ public class NEXIOArchiveCheckerStep extends JobStep { private boolean check(Timestamp modified, Timestamp created, int duration, Media media, int videoFormat, int lastModifiedHours) { String title = media.getTitle(); + //formatum if (!(videoFormat == 3 || videoFormat == 19)) { logger.info(getMarker(), "{} unsupported video format", videoFormat); return false; } + //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); + return false; + } if (modifiedHours < lastModifiedHours) { logger.info(getMarker(), "{} modification time is too cloose for now", title); return false; } - // long count = executeQuery( - // "select count(*) from job where related = ? and NAME = 'Visszatöltés' and STATUS='FINISHED' and HOURS_BETWEEN(?, finished) = 0", title, - // created); - // - // if (count > 0) { - // logger.info(getMarker(), "{} has record date and TSM restore too close", title); - // return true; - // } - + //utolso modositas MediaFile mediaFile = getManager().getSystemMediaFile(media); boolean isModified = true; - if (mediaFile != null) - isModified = df.format(mediaFile.getLastModified()).compareTo(df.format(modified)) < 0; + if (mediaFile == null) { + logger.info(getMarker(), "{} system media file not available", title); + return false; + } + String mcMod = df.format(mediaFile.getLastModified()); + String nexioMod = df.format(modified); + isModified = mcMod.compareTo(nexioMod) < 0; if (isModified) { - logger.info(getMarker(), "{} has different last modification time {} < {}", title, media.getModified(), modified); + logger.info(getMarker(), "{} modification time: MC {} < NEXIO {}", title, mcMod, nexioMod); return true; } boolean isLengthChanged = media.getLength() > 0 && Math.abs(media.getLength() - duration) > 3; if (isLengthChanged) { - logger.info(getMarker(), "{} has different length {} != {}", title, media.getLength(), duration); + logger.info(getMarker(), "{} length: MC {} != NEXIO {}", title, media.getLength(), duration); return true; } @@ -106,47 +110,6 @@ public class NEXIOArchiveCheckerStep extends JobStep { return null; } - // public long executeQuery(String query, String title, Timestamp created) { - // long count = 0; - // - // DefaultContext context = getManager().getDbContext(); - // Connection connection = context.getConnection(); - // - // ResultSet rs = null; - // PreparedStatement st = null; - // try { - // st = connection.prepareStatement(query); - // st.setString(1, title); - // st.setTimestamp(2, created); - // rs = st.executeQuery(); - // if (rs.next()) { - // count = rs.getLong(1); - // } - // - // connection.commit(); - // } catch (Exception e) { - // logger.catching(e); - // try { - // connection.rollback(); - // } catch (Exception e1) { - // } - // } finally { - // try { - // if (rs != null) - // rs.close(); - // } catch (Exception e1) { - // } - // try { - // if (st != null) - // st.close(); - // } catch (Exception e1) { - // } - // - // getManager().putDbContext(context); - // } - // return count; - // } - private void processClips(String storeName, StoreUri sourceStoreUri, StoreUri targetStoreUri, String outputPath, Iterator clips, int lastModifiedHours) throws ClipNotFoundException, IOException, ProtocolException { int processed = 0; @@ -165,8 +128,13 @@ public class NEXIOArchiveCheckerStep extends JobStep { Timestamp modified = null; int frames = 0; int videoFormat = 0; - title = clip.getXid().get(); frames = clip.getDuration(); + + //ures clip + if (frames == 1) + continue; + + title = clip.getXid().get(); created = Timestamp.from(clip.getRecordDateTimestamp().toInstant()); modified = Timestamp.from(clip.getModifiedTimestamp().toInstant()); videoFormat = clip.getVideoFormat();