diff --git a/BUGs b/BUGs index 04e6285..7055b2a 100644 --- a/BUGs +++ b/BUGs @@ -6,6 +6,3 @@ BUG-106: cant add trudy /pat? as refimgs via FaceDBox (it came from a face bbox, BUT, I have grown the face seln by 10%?) BUG-109: add mich force override, removed it, then re-added it, then rebuild DB form scratch and metadata has a duplicate - redo disco metadata with md5 not UUID of face dataS -BUG-114: when moving files, the offered similar dirs include those from other paths: - - when we change the sel_rp (and icon), should also change offered similar dirs - - AND its showing 'Import/Camera_Uploads/...' - is this a path issue in files.py / GetExisting* or? diff --git a/TODO b/TODO index a6add29..da871d4 100644 --- a/TODO +++ b/TODO @@ -9,6 +9,8 @@ * think about security - in job_mgr anywhere I can os.replace/remove NEED to protect, etc + * read this: https://flask.palletsprojects.com/en/2.2.x/testing/#faking-resources-and-context + * could get better AI optim, by keeping track of just new files since scan (even if we did this from the DB), then we could just feed those eid's explicitly into a 'run_ai_on_new_files' :) -- maybe particularly if count('new files') < say 1000 do eids, otherwise do path AND no new refimgs diff --git a/files.py b/files.py index a065ff8..deb90ac 100644 --- a/files.py +++ b/files.py @@ -815,9 +815,10 @@ def GetExistingPathsAsDiv(dt): ret+= '{ ' ret+= '"prefix":"' + bits[0] + '-", ' if len(bits)>1: - ret+= '"suffix":"' + bits[1] + '"' + ret+= '"suffix":"' + bits[1] + '", ' else: - ret+= '"suffix":"''"' + ret+= '"suffix":"''", ' + ret += '"ptype": "'+dir.in_path.type.name+'"' ret+= ' } ' first_dir=0 ret+= ' ]' diff --git a/internal/js/files_support.js b/internal/js/files_support.js index 18e890e..d0bbf46 100644 --- a/internal/js/files_support.js +++ b/internal/js/files_support.js @@ -35,12 +35,18 @@ function change_rp_sel() icon_url = $('option:selected', '#rp_sel').attr('icon_url') $('#move_path_icon').html( '' ) - $('#move_path_type').val( $('option:selected', '#rp_sel').attr('path_type') ) + seld_ptype=$('option:selected', '#rp_sel').attr('path_type') + $('#move_path_type').val( seld_ptype ) + // clear all 'existing' buttons + $('.move_Import').addClass('d-none') + $('.move_Storage').addClass('d-none') + // show just selected path's (relevant) buttons + $('.move_'+seld_ptype).removeClass('d-none') } // POST to see if there are any other existing directories named around this date // (if so display them as options for a move) -function GetExistingDirsAsDiv( dt, divname ) +function GetExistingDirsAsDiv( dt, divname, ptype ) { $.ajax({ type: 'POST', data: null, url: '/getexistingpaths/'+dt, @@ -49,10 +55,17 @@ function GetExistingDirsAsDiv( dt, divname ) dirs = JSON.parse(data) s='' dirs.forEach( function(item, index) { - s+= '' + if( item.ptype != ptype ) + vis = 'd-none ' + else + vis = '' + s+= '' } ) if( s == '' ) $('#existing').html('') + else + $('#move_'+ptype).removeClass('invisible') $('#'+divname).html(s) } } ) @@ -86,8 +99,8 @@ function MoveDBox(path_details, db_url) div+=GetSelnAsDiv() yr=$('.highlight').first().attr('yr') dt=$('.highlight').first().attr('date') - div+='
Use Existing:
' - GetExistingDirsAsDiv( dt, "existing" ) + div+='
Use Existing Directory (in the chosen path):
' + GetExistingDirsAsDiv( dt, "existing", path_details[0].type ) div+=`