fixed BUG-114 -> only show path-specific existing options in movedbox. Added test doc to read to TODO
This commit is contained in:
3
BUGs
3
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%?)
|
(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
|
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
|
- 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?
|
|
||||||
|
|||||||
2
TODO
2
TODO
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
* think about security - in job_mgr anywhere I can os.replace/remove NEED to protect, etc
|
* 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),
|
* 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
|
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
|
if count('new files') < say 1000 do eids, otherwise do path AND no new refimgs
|
||||||
|
|||||||
5
files.py
5
files.py
@@ -815,9 +815,10 @@ def GetExistingPathsAsDiv(dt):
|
|||||||
ret+= '{ '
|
ret+= '{ '
|
||||||
ret+= '"prefix":"' + bits[0] + '-", '
|
ret+= '"prefix":"' + bits[0] + '-", '
|
||||||
if len(bits)>1:
|
if len(bits)>1:
|
||||||
ret+= '"suffix":"' + bits[1] + '"'
|
ret+= '"suffix":"' + bits[1] + '", '
|
||||||
else:
|
else:
|
||||||
ret+= '"suffix":"''"'
|
ret+= '"suffix":"''", '
|
||||||
|
ret += '"ptype": "'+dir.in_path.type.name+'"'
|
||||||
ret+= ' } '
|
ret+= ' } '
|
||||||
first_dir=0
|
first_dir=0
|
||||||
ret+= ' ]'
|
ret+= ' ]'
|
||||||
|
|||||||
@@ -35,12 +35,18 @@ function change_rp_sel()
|
|||||||
icon_url = $('option:selected', '#rp_sel').attr('icon_url')
|
icon_url = $('option:selected', '#rp_sel').attr('icon_url')
|
||||||
$('#move_path_icon').html( '<svg id="move_path_icon" width="20" height="20" fill="currentColor"><use xlink:href="'
|
$('#move_path_icon').html( '<svg id="move_path_icon" width="20" height="20" fill="currentColor"><use xlink:href="'
|
||||||
+ icon_url + '"></svg>' )
|
+ icon_url + '"></svg>' )
|
||||||
$('#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
|
// POST to see if there are any other existing directories named around this date
|
||||||
// (if so display them as options for a move)
|
// (if so display them as options for a move)
|
||||||
function GetExistingDirsAsDiv( dt, divname )
|
function GetExistingDirsAsDiv( dt, divname, ptype )
|
||||||
{
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST', data: null, url: '/getexistingpaths/'+dt,
|
type: 'POST', data: null, url: '/getexistingpaths/'+dt,
|
||||||
@@ -49,10 +55,17 @@ function GetExistingDirsAsDiv( dt, divname )
|
|||||||
dirs = JSON.parse(data)
|
dirs = JSON.parse(data)
|
||||||
s=''
|
s=''
|
||||||
dirs.forEach( function(item, index) {
|
dirs.forEach( function(item, index) {
|
||||||
s+= '<button class="btn btn-outline-primary" type="button" onClick="$(\'#prefix\').val(\''+item.prefix+'\'); $(\'#suffix\').val(\''+item.suffix+'\');return false;">'+item.prefix+item.suffix+'</button>'
|
if( item.ptype != ptype )
|
||||||
|
vis = 'd-none '
|
||||||
|
else
|
||||||
|
vis = ''
|
||||||
|
s+= '<button class="btn btn-outline-primary move_'+item.ptype+ ' ' + vis + '" '
|
||||||
|
s+= 'onClick="$(\'#prefix\').val(\''+item.prefix+'\'); $(\'#suffix\').val(\''+item.suffix+'\');return false;">'+item.prefix+item.suffix+'</button>'
|
||||||
} )
|
} )
|
||||||
if( s == '' )
|
if( s == '' )
|
||||||
$('#existing').html('')
|
$('#existing').html('')
|
||||||
|
else
|
||||||
|
$('#move_'+ptype).removeClass('invisible')
|
||||||
$('#'+divname).html(s)
|
$('#'+divname).html(s)
|
||||||
}
|
}
|
||||||
} )
|
} )
|
||||||
@@ -86,8 +99,8 @@ function MoveDBox(path_details, db_url)
|
|||||||
div+=GetSelnAsDiv()
|
div+=GetSelnAsDiv()
|
||||||
yr=$('.highlight').first().attr('yr')
|
yr=$('.highlight').first().attr('yr')
|
||||||
dt=$('.highlight').first().attr('date')
|
dt=$('.highlight').first().attr('date')
|
||||||
div+='<div id="existing" class="col-12">Use Existing:</div><div id="existing"></div>'
|
div+='<div class="row">Use Existing Directory (in the chosen path):</div><div id="existing"></div>'
|
||||||
GetExistingDirsAsDiv( dt, "existing" )
|
GetExistingDirsAsDiv( dt, "existing", path_details[0].type )
|
||||||
div+=`
|
div+=`
|
||||||
<div class="input-group my-3">
|
<div class="input-group my-3">
|
||||||
<alert class="alert alert-primary my-auto py-1">
|
<alert class="alert alert-primary my-auto py-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user