private boolean check(Timestamp modified, Timestamp created, int duration, Media media, int videoFormat, int lastModifiedHours) {\r
String title = media.getTitle();\r
\r
+ //formatum\r
if (!(videoFormat == 3 || videoFormat == 19)) {\r
logger.info(getMarker(), "{} unsupported video format", videoFormat);\r
return false;\r
}\r
\r
+ //utolso modositas a mosthoz kepest\r
+ //The result of this method can be a negative period if the end is before the start.\r
long modifiedHours = Duration.between(modified.toInstant(), Instant.now()).toHours();\r
+ if (modifiedHours < 0) {\r
+ logger.info(getMarker(), "{} modification time greather than now", title);\r
+ return false;\r
+ }\r
if (modifiedHours < lastModifiedHours) {\r
logger.info(getMarker(), "{} modification time is too cloose for now", title);\r
return false;\r
}\r
\r
- // long count = executeQuery(\r
- // "select count(*) from job where related = ? and NAME = 'Visszatöltés' and STATUS='FINISHED' and HOURS_BETWEEN(?, finished) = 0", title,\r
- // created);\r
- //\r
- // if (count > 0) {\r
- // logger.info(getMarker(), "{} has record date and TSM restore too close", title);\r
- // return true;\r
- // }\r
-\r
+ //utolso modositas\r
MediaFile mediaFile = getManager().getSystemMediaFile(media);\r
boolean isModified = true;\r
- if (mediaFile != null)\r
- isModified = df.format(mediaFile.getLastModified()).compareTo(df.format(modified)) < 0;\r
+ if (mediaFile == null) {\r
+ logger.info(getMarker(), "{} system media file not available", title);\r
+ return false;\r
+ }\r
\r
+ String mcMod = df.format(mediaFile.getLastModified());\r
+ String nexioMod = df.format(modified);\r
+ isModified = mcMod.compareTo(nexioMod) < 0;\r
if (isModified) {\r
- logger.info(getMarker(), "{} has different last modification time {} < {}", title, media.getModified(), modified);\r
+ logger.info(getMarker(), "{} modification time: MC {} < NEXIO {}", title, mcMod, nexioMod);\r
return true;\r
}\r
\r
boolean isLengthChanged = media.getLength() > 0 && Math.abs(media.getLength() - duration) > 3;\r
if (isLengthChanged) {\r
- logger.info(getMarker(), "{} has different length {} != {}", title, media.getLength(), duration);\r
+ logger.info(getMarker(), "{} length: MC {} != NEXIO {}", title, media.getLength(), duration);\r
return true;\r
}\r
\r
return null;\r
}\r
\r
- // public long executeQuery(String query, String title, Timestamp created) {\r
- // long count = 0;\r
- //\r
- // DefaultContext context = getManager().getDbContext();\r
- // Connection connection = context.getConnection();\r
- //\r
- // ResultSet rs = null;\r
- // PreparedStatement st = null;\r
- // try {\r
- // st = connection.prepareStatement(query);\r
- // st.setString(1, title);\r
- // st.setTimestamp(2, created);\r
- // rs = st.executeQuery();\r
- // if (rs.next()) {\r
- // count = rs.getLong(1);\r
- // }\r
- //\r
- // connection.commit();\r
- // } catch (Exception e) {\r
- // logger.catching(e);\r
- // try {\r
- // connection.rollback();\r
- // } catch (Exception e1) {\r
- // }\r
- // } finally {\r
- // try {\r
- // if (rs != null)\r
- // rs.close();\r
- // } catch (Exception e1) {\r
- // }\r
- // try {\r
- // if (st != null)\r
- // st.close();\r
- // } catch (Exception e1) {\r
- // }\r
- //\r
- // getManager().putDbContext(context);\r
- // }\r
- // return count;\r
- // }\r
-\r
private void processClips(String storeName, StoreUri sourceStoreUri, StoreUri targetStoreUri, String outputPath, Iterator<Clip> clips,\r
int lastModifiedHours) throws ClipNotFoundException, IOException, ProtocolException {\r
int processed = 0;\r
Timestamp modified = null;\r
int frames = 0;\r
int videoFormat = 0;\r
- title = clip.getXid().get();\r
frames = clip.getDuration();\r
+\r
+ //ures clip\r
+ if (frames == 1)\r
+ continue;\r
+\r
+ title = clip.getXid().get();\r
created = Timestamp.from(clip.getRecordDateTimestamp().toInstant());\r
modified = Timestamp.from(clip.getModifiedTimestamp().toInstant());\r
videoFormat = clip.getVideoFormat();\r