Add 60s tolerance when compare date_original, date_filename and

date_created
This commit is contained in:
Cédric Leporcq 2022-07-19 21:45:11 +02:00
parent cdfa408206
commit 52768f64db
1 changed files with 19 additions and 15 deletions

View File

@ -370,6 +370,8 @@ class Media(ReadExif):
file_modify_date = self.metadata['file_modify_date']
if self.metadata['date_original']:
if date_filename and date_filename != date_original:
timedelta = abs(date_original - date_filename)
if timedelta.total_seconds() > 60:
self.log.warning(
f"{filename} time mark is different from {date_original}"
)
@ -392,6 +394,8 @@ class Media(ReadExif):
f"use date from filename:{date_filename} for {self.file_path}"
)
if date_created and date_filename > date_created:
timedelta = abs(date_created - date_filename)
if timedelta.total_seconds() > 60:
self.log.warning(
f"{filename} time mark is more recent than {date_created}"
)