From dba83a29004a4a7283387a9a4dcba79a872aac4e Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 15 Apr 2023 13:22:17 +0200 Subject: [PATCH] Fixes for sqlalachemy2 --- cps/gdriveutils.py | 2 +- cps/tasks/thumbnail.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/gdriveutils.py b/cps/gdriveutils.py index f50a2f3f..08ead47d 100644 --- a/cps/gdriveutils.py +++ b/cps/gdriveutils.py @@ -147,7 +147,7 @@ engine = create_engine('sqlite:///{0}'.format(cli_param.gd_path), echo=False) Base = declarative_base() # Open session for database connection -Session = sessionmaker() +Session = sessionmaker(autoflush=False) Session.configure(bind=engine) session = scoped_session(Session) diff --git a/cps/tasks/thumbnail.py b/cps/tasks/thumbnail.py index e66da036..6d11fe97 100644 --- a/cps/tasks/thumbnail.py +++ b/cps/tasks/thumbnail.py @@ -138,7 +138,7 @@ class TaskGenerateCoverThumbnails(CalibreTask): # Replace outdated or missing thumbnails for thumbnail in book_cover_thumbnails: - if book.last_modified > thumbnail.generated_at: + if book.last_modified.replace(tzinfo=None) > thumbnail.generated_at: generated += 1 self.update_book_cover_thumbnail(book, thumbnail)