+6
-1
@@ -111,8 +111,12 @@ class NFOGuardDatabase:
|
||||
else:
|
||||
self._init_sqlite_tables(cursor)
|
||||
|
||||
# Test the connection works
|
||||
# Test the connection works and verify autocommit
|
||||
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()}")
|
||||
|
||||
def _init_postgresql_tables(self, cursor):
|
||||
@@ -306,6 +310,7 @@ class NFOGuardDatabase:
|
||||
has_video_file = EXCLUDED.has_video_file,
|
||||
last_updated = EXCLUDED.last_updated
|
||||
""", (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:
|
||||
cursor.execute("""
|
||||
INSERT OR REPLACE INTO episodes
|
||||
|
||||
Reference in New Issue
Block a user