From cfd4a3071f07042a68485e68502a5250e9f9f57e Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 22 Jan 2021 16:32:30 +1100 Subject: [PATCH 1/4] fix current_file_num and num_files being wrong in import and gen*details jobs --- pa_job_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pa_job_manager.py b/pa_job_manager.py index 63971fa..23d7923 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -407,6 +407,7 @@ def JobNewImportDir(job): dir.num_files=len(files)+len(subdirs) dir.last_import_date = time.time() job.num_files=overall_file_cnt + job.current_file_num=overall_file_cnt FinishJob(job, "Finished Importing: {} - Found {} new files".format( path, overall_file_cnt ) ) ####### NEED TO FIX THIS BASED ON os.walk contents import_dir=session.query(Dir).filter(Dir.path_prefix==symlink).first() @@ -534,6 +535,7 @@ def ProcessFilesInDir(job, e, file_func, go_into_dir_func): file_func(job, e) else: dir=session.query(Dir).filter(Dir.eid==e.id).first() + job.current_file_num+=1 # if this func returns if not go_into_dir_func(dir): return From db5bba551f0459c2aba653277262590e627d3629 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 22 Jan 2021 16:33:24 +1100 Subject: [PATCH 2/4] added some BUGs --- BUGs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/BUGs b/BUGs index 6ae5fc8..99914a4 100644 --- a/BUGs +++ b/BUGs @@ -1,6 +1,9 @@ -### Next: 8 -BUG-2: Fix the function FixPath so its not just C:, use isPosixPath instead... -BUG-3: import job (first time, does not update with #files as it runs) -BUG-4: Duration is borked and comes out as -1 day under jobs (windows created jobs only) -BUG-6: add a new file (e.g. touch an image in the import dir), and keep_dir[] has missing key -BUG-7: thumbnail orientation issues (see latest image from my phone - of laptop) +### Next: 11 + BUG-2: Fix the function FixPath so its not just C:, use isPosixPath instead... + BUG-3: import job (first time, does not update with #files as it runs) + BUG-4: Duration is borked and comes out as -1 day under jobs (windows created jobs only) + BUG-6: add a new file (e.g. touch an image in the import dir), and keep_dir[] has missing key + BUG-7: thumbnail orientation issues (see latest image from my phone - of laptop) + BUG-8: cascading failure jobs are needed + BUG-9: import_path's and entry path_prefix issues when ProcessFilsInDir (in fact, should I really wrap all of that so no one sees its) +BUG-10: gen*details will stop if no change to top-level dir, but not look in subdirs From 01d0663e16ecc0bf2682f14997b3672c3ad6f001 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 22 Jan 2021 18:41:46 +1100 Subject: [PATCH 3/4] fix bug with id not eid --- person.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/person.py b/person.py index 8c7c2e3..a5af609 100644 --- a/person.py +++ b/person.py @@ -24,7 +24,7 @@ class Person(db.Model): class File_Person_Link(db.Model): __tablename__ = "file_person_link" - file_id = db.Column(db.Integer, db.ForeignKey('file.id'), unique=True, nullable=False, primary_key=True) + file_eid = db.Column(db.Integer, db.ForeignKey('file.eid'), unique=True, nullable=False, primary_key=True) person_id = db.Column(db.Integer, db.ForeignKey('person.id'), unique=True, nullable=False, primary_key=True) def __repr__(self): From 2e5811adf45284985e2934b32486b2fc156f101e Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 22 Jan 2021 18:42:07 +1100 Subject: [PATCH 4/4] changed encoding to bytea --- tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables.sql b/tables.sql index 126f019..ad17e7f 100644 --- a/tables.sql +++ b/tables.sql @@ -24,7 +24,7 @@ create table ENTRY_DIR_LINK ( entry_id integer, dir_eid integer, create table PERSON ( ID integer, TAG varchar(48), FIRSTNAME varchar(48), SURNAME varchar(48), constraint PK_PERSON_ID primary key(ID) ); -create table REFIMG ( ID integer, FNAME varchar(256), ENCODINGS varchar, +create table REFIMG ( ID integer, FNAME varchar(256), ENCODINGS bytea, constraint PK_REFIMG_ID primary key(ID) ); create table FILE_PERSON_LINK ( FILE_ID integer, PERSON_ID integer,