소스 검색

Some light rewrite

jherve 1 년 전
부모
커밋
0a9d277ed8
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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(