@@ -62,7 +62,8 @@ def db_create_images_table() -> None:
6262 cursor = conn .cursor ()
6363
6464 # Create new images table with merged fields including Memories feature columns
65- cursor .execute ("""
65+ cursor .execute (
66+ """
6667 CREATE TABLE IF NOT EXISTS images (
6768 id TEXT PRIMARY KEY,
6869 path VARCHAR UNIQUE,
@@ -76,7 +77,8 @@ def db_create_images_table() -> None:
7677 captured_at DATETIME,
7778 FOREIGN KEY (folder_id) REFERENCES folders(folder_id) ON DELETE CASCADE
7879 )
79- """ )
80+ """
81+ )
8082
8183 # Create indexes for Memories feature queries
8284 cursor .execute ("CREATE INDEX IF NOT EXISTS ix_images_latitude ON images(latitude)" )
@@ -91,15 +93,17 @@ def db_create_images_table() -> None:
9193 )
9294
9395 # Create new image_classes junction table
94- cursor .execute ("""
96+ cursor .execute (
97+ """
9598 CREATE TABLE IF NOT EXISTS image_classes (
9699 image_id TEXT,
97100 class_id INTEGER,
98101 PRIMARY KEY (image_id, class_id),
99102 FOREIGN KEY (image_id) REFERENCES images(id) ON DELETE CASCADE,
100103 FOREIGN KEY (class_id) REFERENCES mappings(class_id) ON DELETE CASCADE
101104 )
102- """ )
105+ """
106+ )
103107
104108 conn .commit ()
105109 conn .close ()
@@ -261,13 +265,15 @@ def db_get_untagged_images() -> List[UntaggedImageRecord]:
261265 cursor = conn .cursor ()
262266
263267 try :
264- cursor .execute ("""
268+ cursor .execute (
269+ """
265270 SELECT i.id, i.path, i.folder_id, i.thumbnailPath, i.metadata
266271 FROM images i
267272 JOIN folders f ON i.folder_id = f.folder_id
268273 WHERE f.AI_Tagging = TRUE
269274 AND i.isTagged = FALSE
270- """ )
275+ """
276+ )
271277
272278 results = cursor .fetchall ()
273279
@@ -748,7 +754,8 @@ def db_get_images_with_location() -> List[dict]:
748754 cursor = conn .cursor ()
749755
750756 try :
751- cursor .execute ("""
757+ cursor .execute (
758+ """
752759 SELECT
753760 i.id,
754761 i.path,
@@ -768,7 +775,8 @@ def db_get_images_with_location() -> List[dict]:
768775 AND i.longitude IS NOT NULL
769776 GROUP BY i.id
770777 ORDER BY i.captured_at DESC
771- """ )
778+ """
779+ )
772780
773781 results = cursor .fetchall ()
774782
@@ -813,7 +821,8 @@ def db_get_all_images_for_memories() -> List[dict]:
813821 cursor = conn .cursor ()
814822
815823 try :
816- cursor .execute ("""
824+ cursor .execute (
825+ """
817826 SELECT
818827 i.id,
819828 i.path,
@@ -831,7 +840,8 @@ def db_get_all_images_for_memories() -> List[dict]:
831840 LEFT JOIN mappings m ON ic.class_id = m.class_id
832841 GROUP BY i.id
833842 ORDER BY i.captured_at DESC
834- """ )
843+ """
844+ )
835845
836846 results = cursor .fetchall ()
837847
0 commit comments