fixed BUG-54/55, viewer now works in PROD, current_file being set in run_ai_on job, added "new" bug-53 re video fname not being set properly when next/prev in viewer

This commit is contained in:
2021-09-14 17:56:06 +10:00
parent 14950e2f02
commit 301b3d220b
5 changed files with 10 additions and 19 deletions

View File

@@ -591,7 +591,6 @@ def AddLogForJob(job, message):
if hasattr(job, 'last_commit'):
if (now - job.last_commit).seconds > 5:
job.last_commmit=now
print( "DELME: we have taken longer than 5 seconds since last commit so do it")
session.commit()
else:
job.last_commit = now
@@ -1215,11 +1214,7 @@ def RunFuncOnFilesInPath( job, path, file_func, count_dirs ):
####################################################################################################################################
def WrapperForScanFileForPerson(job, entry):
if entry.type.name == 'Image':
if DEBUG:
AddLogForJob( job, f'INFO: processing File: {entry.name}' )
ScanFileForPerson( job, entry, force=False)
# processed this file, add 1 to count
job.current_file_num+=1
return
####################################################################################################################################
@@ -1271,8 +1266,6 @@ def JobRunAIOn(job):
elif entry.type.name == 'Image':
which_file=session.query(Entry).join(File).filter(Entry.id==jex.value).first()
ScanFileForPerson( job, which_file, force=False)
# processed this file, add 1 to count
job.current_file_num+=1
else:
AddLogForJob( job, f'Not processing Entry: {entry.name} - not an image' )
FinishJob(job, "Finished Processesing AI")
@@ -1746,8 +1739,8 @@ def ScanFileForPerson( job, e, force=False ):
model=session.query(AIModel).get(settings.default_scan_model)
threshold = settings.default_threshold
if DEBUG:
AddLogForJob( job, f'INFO: processing File: {e.name} and threshold face distance of {threshold}' )
# add log, set current_file and increment file_num in job
ProcessFileForJob( job, f'INFO: processing File: {e.name} and threshold face distance of {threshold}', e.name )
file_h = session.query(File).get( e.id )
# if we are forcing this, delete any old faces (this will also delete linked tables), and reset faces_created_on to None
if force: