use full path for current_file I think its more meaningful, and also extra optimisation - if same md5 hash, dont redo thumbnail
This commit is contained in:
@@ -568,7 +568,7 @@ def JobsForPaths( parent_job, paths, ptype ):
|
||||
# and then add a log to say we have processed this file
|
||||
##############################################################################
|
||||
def ProcessFileForJob(job, message, current_file):
|
||||
job.current_file=os.path.basename(current_file)
|
||||
job.current_file=current_file
|
||||
if job.num_files:
|
||||
job.current_file_num=job.current_file_num+1
|
||||
AddLogForJob(job, message )
|
||||
@@ -1314,7 +1314,13 @@ def GenHashAndThumb(job, e):
|
||||
job.current_file_num+=1
|
||||
return
|
||||
|
||||
e.file_details.hash = md5( job, e.FullPathOnFS() )
|
||||
new_hash = md5( job, e.FullPathOnFS() )
|
||||
if new_hash == e.file_details.hash:
|
||||
if DEBUG:
|
||||
print(f"OPTIM: GenHashAndThumb {e.name} md5 is same - likely a mv on filesystem so skip md5/thumb")
|
||||
job.current_file_num+=1
|
||||
return
|
||||
e.file_details.hash = new_hash
|
||||
if e.type.name == 'Image':
|
||||
e.file_details.thumbnail = GenImageThumbnail( job, e.FullPathOnFS() )
|
||||
elif e.type.name == 'Video':
|
||||
|
||||
Reference in New Issue
Block a user