Skip to content

Commit

Permalink
importEHdb: Check if the database is out of date
Browse files Browse the repository at this point in the history
  • Loading branch information
URenko committed Feb 2, 2024
1 parent d56bb53 commit 40cdd03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comiclib/scanner/30-importEHdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def __init__(self) -> None:
db_path = urlsplit(settings.importEHdb_database_URI).path
if Path(db_path).exists():
self.con = sqlite3.connect(settings.importEHdb_database_URI, uri=True, check_same_thread=False)
# Check if the database is out of date
if self.con.execute("SELECT posted FROM gallery INDEXED BY gallery_posted ORDER BY posted DESC LIMIT 1").fetchone()[0] < 1705903491:
logger.warning("There is a new version of api_dump.sqlite, you can download it from https://sukebei.nyaa.si/user/gipaf23445")
# Build cache during the first run
if settings.importEHdb_matchtitle:
req_title2gid_index = self.con.execute(f"SELECT name FROM sqlite_master WHERE type='index' AND name=?", (title2gid_index,)).fetchone() is None
Expand Down

0 comments on commit 40cdd03

Please sign in to comment.