Skip to content

Commit 40cdd03

Browse files
committed
importEHdb: Check if the database is out of date
1 parent d56bb53 commit 40cdd03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

comiclib/scanner/30-importEHdb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def __init__(self) -> None:
6666
db_path = urlsplit(settings.importEHdb_database_URI).path
6767
if Path(db_path).exists():
6868
self.con = sqlite3.connect(settings.importEHdb_database_URI, uri=True, check_same_thread=False)
69+
# Check if the database is out of date
70+
if self.con.execute("SELECT posted FROM gallery INDEXED BY gallery_posted ORDER BY posted DESC LIMIT 1").fetchone()[0] < 1705903491:
71+
logger.warning("There is a new version of api_dump.sqlite, you can download it from https://sukebei.nyaa.si/user/gipaf23445")
6972
# Build cache during the first run
7073
if settings.importEHdb_matchtitle:
7174
req_title2gid_index = self.con.execute(f"SELECT name FROM sqlite_master WHERE type='index' AND name=?", (title2gid_index,)).fetchone() is None

0 commit comments

Comments
 (0)