db: debug
Local Docker Build (Dev) / build-dev (push) Successful in 4s

This commit is contained in:
2025-10-18 09:32:42 -04:00
parent cb18c358c6
commit 6c353dcaf8
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
2.3.8 2.3.9
+6 -1
View File
@@ -111,8 +111,12 @@ class NFOGuardDatabase:
else: else:
self._init_sqlite_tables(cursor) self._init_sqlite_tables(cursor)
# Test the connection works # Test the connection works and verify autocommit
cursor.execute("SELECT 1") cursor.execute("SELECT 1")
if self.db_type == "postgresql":
print(f"✅ Database initialized and connection verified: {self.db_type.upper()}")
print(f"🔍 PostgreSQL autocommit status: {conn.autocommit}")
else:
print(f"✅ Database initialized and connection verified: {self.db_type.upper()}") print(f"✅ Database initialized and connection verified: {self.db_type.upper()}")
def _init_postgresql_tables(self, cursor): def _init_postgresql_tables(self, cursor):
@@ -306,6 +310,7 @@ class NFOGuardDatabase:
has_video_file = EXCLUDED.has_video_file, has_video_file = EXCLUDED.has_video_file,
last_updated = EXCLUDED.last_updated last_updated = EXCLUDED.last_updated
""", (imdb_id, season, episode, aired, dateadded, source, has_video_file, timestamp)) """, (imdb_id, season, episode, aired, dateadded, source, has_video_file, timestamp))
print(f"🔍 DEBUG: PostgreSQL upsert executed for {imdb_id} S{season:02d}E{episode:02d}, rows affected: {cursor.rowcount}")
else: else:
cursor.execute(""" cursor.execute("""
INSERT OR REPLACE INTO episodes INSERT OR REPLACE INTO episodes