use stat_mtime for gen hash (as moving a file does not change content) AND for fall-back date/time of importing a photo -- Fixes BUG-72
This commit is contained in:
@@ -1128,7 +1128,7 @@ def GetDateFromFile(file, stat):
|
||||
check2 = datetime( year, month, day )
|
||||
# give up and use file sys date
|
||||
except:
|
||||
year, month, day, _, _, _, _, _, _ = datetime.fromtimestamp(stat.st_ctime).timetuple()
|
||||
year, month, day, _, _, _, _, _, _ = datetime.fromtimestamp(stat.st_mtime).timetuple()
|
||||
c=date(year, month, day).isocalendar()
|
||||
woy=c[1]
|
||||
return year, month, day, woy
|
||||
@@ -1349,7 +1349,7 @@ def GenHashAndThumb(job, e):
|
||||
if job.current_file_num % 100 == 0:
|
||||
session.commit()
|
||||
stat = os.stat( e.FullPathOnFS() )
|
||||
if stat.st_ctime < e.file_details.last_hash_date:
|
||||
if stat.st_mtime < e.file_details.last_hash_date:
|
||||
if DEBUG:
|
||||
print(f"OPTIM: GenHashAndThumb {e.name} file is older than last hash, skip this")
|
||||
job.current_file_num+=1
|
||||
|
||||
Reference in New Issue
Block a user