Quellcode durchsuchen

Some light rewrite

jherve vor 1 Jahr
Ursprung
Commit
0a9d277ed8
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      src/de_quoi_parle_le_monde/storage.py

+ 4 - 1
src/de_quoi_parle_le_monde/storage.py

@@ -323,7 +323,7 @@ class Storage:
                 [name, dt],
             )
 
-            return exists != []
+        return exists != []
 
     async def list_all_featured_article_snapshots(self):
         async with self.conn as conn:
@@ -340,6 +340,9 @@ class Storage:
             ]
 
     async def list_snapshot_apparitions(self, featured_article_snapshot_ids: list[int]):
+        if len(featured_article_snapshot_ids) == 0:
+            return []
+
         async with self.conn as conn:
             placeholders = ", ".join(["?" for _ in featured_article_snapshot_ids])
             rows = await conn.execute_fetchall(