diff --git a/BUGs b/BUGs index 0a4fa62..db40659 100644 --- a/BUGs +++ b/BUGs @@ -1,4 +1,3 @@ ### Next: 56 BUG-52: updated tag on person, and it said successful, but the colour was red/danger -BUG-54: URL for viewing image/video is broken in Prod, reference mara:5000 rather than rel path... (might need a ../ ?) -BUG-55: current file in run_ai_on is not being set... +BUG-53: when viewing list, moving to a video and the name of the file is not updated (are there 2 in the dom?) diff --git a/TODO b/TODO index 2db8e8f..fc48038 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,7 @@ ## GENERAL * get build process to create a random string for secret for PROD, otherwise use builtin for dev - * lighthouse -> leverage this for cache control for static... - https://www.kite.com/python/docs/flask.Flask.get_send_file_max_age + * lighthouse -> check in PROD, all ssl / viewer works? * comment your code * html files? diff --git a/internal/js/view_support.js b/internal/js/view_support.js index c51b6ee..f02fa6e 100644 --- a/internal/js/view_support.js +++ b/internal/js/view_support.js @@ -153,7 +153,7 @@ function ViewImageOrVideo() { if( objs[current].type == 'Image' ) { - im.src='http://mara.ddp.net:5000/' + objs[current].url + im.src='../' + objs[current].url $('#video').hide() $('#vid-caption').hide() $('#figure').show() @@ -162,7 +162,7 @@ function ViewImageOrVideo() } if( objs[current].type == 'Video' ) { - $('#video').prop('src', 'http://mara.ddp.net:5000/' + objs[current].url ) + $('#video').prop('src', '../' + objs[current].url ) $('#figure').hide() $('#video').show() $('#vid-caption').show() diff --git a/pa_job_manager.py b/pa_job_manager.py index 1cba183..8006764 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -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: diff --git a/templates/viewer.html b/templates/viewer.html index 4ae933d..045f380 100644 --- a/templates/viewer.html +++ b/templates/viewer.html @@ -29,8 +29,8 @@ {% for id in objs %} e=new Object() - e.name = "{{objs[id].name}}" - e.url = "{{objs[id].FullPathOnFS()}}" + e.name = "{{objs[id].name|safe}}" + e.url = "{{objs[id].FullPathOnFS()|safe}}" e.type = "{{objs[id].type.name}}" {% if objs[id].file_details.faces %} e.face_model="{{objs[id].file_details.faces[0].facefile_lnk.model_used}}" @@ -113,7 +113,7 @@ @@ -124,7 +124,7 @@ {% endif %}
{{objs[current].name}}