wrapped ProcessFilesInDir to just take a job, path, file_func to run, updated TODOs appropriately - added sql for duplicates check to TODO
This commit is contained in:
12
TODO
12
TODO
@@ -10,9 +10,6 @@
|
|||||||
### BACKEND
|
### BACKEND
|
||||||
*** Need to use thread-safe sessions per Thread, half-assed version did not work
|
*** Need to use thread-safe sessions per Thread, half-assed version did not work
|
||||||
|
|
||||||
* ProcessFilesInDir (should take a path, and do the first for loop so that no one sees the recursive func)
|
|
||||||
* Handle file deletions from file system (remove dangling DIR/FILE combos) -- also when moving to storage_dir, need to reset DIR, but keep FILE data
|
|
||||||
|
|
||||||
Future:
|
Future:
|
||||||
Admin
|
Admin
|
||||||
-> reset face_flag
|
-> reset face_flag
|
||||||
@@ -23,17 +20,20 @@
|
|||||||
thresholds on AI, or we get a new/better one some day, then it can
|
thresholds on AI, or we get a new/better one some day, then it can
|
||||||
all images with faces, or if we 'reset face_flag' rescan all images
|
all images with faces, or if we 'reset face_flag' rescan all images
|
||||||
|
|
||||||
|
Admin
|
||||||
|
-> delete old jobs / auto delete jobs older than ???
|
||||||
|
|
||||||
### UI
|
### UI
|
||||||
|
|
||||||
### AI
|
### AI
|
||||||
* store reference images (UI allows this now)
|
|
||||||
* check images
|
|
||||||
* allow for threshold/settings to be tweaked from the GUI
|
* allow for threshold/settings to be tweaked from the GUI
|
||||||
- it would be good to then say, just run the scanner against this image or maybe this DIR, to see how it IDs ppl
|
- it would be good to then say, just run the scanner against this image or maybe this DIR, to see how it IDs ppl
|
||||||
When AI kicks in, it processes per person per DIR, only compares to an image if it has_unidentified_face
|
|
||||||
|
|
||||||
|
|
||||||
### SORTER
|
### SORTER
|
||||||
|
* duplicate files - this sql finds them:
|
||||||
|
select d1.path_prefix, e1.name, f1.hash from entry e1, file f1, dir d1, entry_dir_link edl1, entry e2, file f2 where e1.id = f1.eid and e2.id = f2.eid and d1.eid = edl1.dir_eid and edl1.entry_id = e1.id and f1.hash = f2.hash and e1.name != e2.name
|
||||||
|
|
||||||
* date stuff
|
* date stuff
|
||||||
* exif processing?
|
* exif processing?
|
||||||
* location stuff - test a new photo from my camera out
|
* location stuff - test a new photo from my camera out
|
||||||
|
|||||||
@@ -527,6 +527,12 @@ def JobImportDir(job):
|
|||||||
session.commit()
|
session.commit()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def RunFuncOnFilesInPath( job, path, file_func ):
|
||||||
|
d=session.query(Dir).filter(Dir.path_prefix==path).first()
|
||||||
|
for e in d.files:
|
||||||
|
ProcessFilesInDir(job, e, file_func)
|
||||||
|
|
||||||
|
|
||||||
def JobProcessAI(job):
|
def JobProcessAI(job):
|
||||||
path=[jex.value for jex in job.extra if jex.name == "path"][0]
|
path=[jex.value for jex in job.extra if jex.name == "path"][0]
|
||||||
path = SymlinkName(path, '/')
|
path = SymlinkName(path, '/')
|
||||||
@@ -537,14 +543,11 @@ def JobProcessAI(job):
|
|||||||
for person in people:
|
for person in people:
|
||||||
generateKnownEncodings(person)
|
generateKnownEncodings(person)
|
||||||
|
|
||||||
for e in FilesInDir( path ):
|
RunFuncOnFilesInPath( job, path, ProcessAI )
|
||||||
ProcessFilesInDir(job, e, ProcessAI)
|
|
||||||
FinishJob(job, "Finished Processesing AI")
|
FinishJob(job, "Finished Processesing AI")
|
||||||
return
|
return
|
||||||
|
|
||||||
def FilesInDir( path ):
|
|
||||||
d=session.query(Dir).filter(Dir.path_prefix==path).first()
|
|
||||||
return d.files
|
|
||||||
|
|
||||||
def GenHashAndThumb(job, e):
|
def GenHashAndThumb(job, e):
|
||||||
stat = os.stat( e.in_dir[0].path_prefix + '/' + e.name )
|
stat = os.stat( e.in_dir[0].path_prefix + '/' + e.name )
|
||||||
@@ -678,8 +681,7 @@ def JobGetFileDetails(job):
|
|||||||
job.current_file_num = 0
|
job.current_file_num = 0
|
||||||
job.num_files = dir.num_files
|
job.num_files = dir.num_files
|
||||||
session.commit()
|
session.commit()
|
||||||
for e in FilesInDir( path ):
|
RunFuncOnFilesInPath( job, path, GenHashAndThumb )
|
||||||
ProcessFilesInDir(job, e, GenHashAndThumb )
|
|
||||||
FinishJob(job, "File Details job finished")
|
FinishJob(job, "File Details job finished")
|
||||||
session.commit()
|
session.commit()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user