feat(userbot,api,frontend): backfill stories and unbreak all-stories list

This commit is contained in:
hh committed 2026-08-06 14:08:10 +02:00
1 parent 1e143c7573
commit 12cc7d57e3
11 files changed
+326 -102

No files matched your search

@@ -22,6 +22,20 @@ ON CONFLICT (account_id, peer_id, story_id) DO UPDATE SET
"""
async def is_downloaded(
pool: asyncpg.Pool, account_id: int, peer_id: int, story_id: int
) -> bool:
return bool(
await pool.fetchval(
"SELECT downloaded FROM stories "
"WHERE account_id = $1 AND peer_id = $2 AND story_id = $3",
account_id,
peer_id,
story_id,
)
)
async def upsert_story( # noqa: PLR0913
pool: asyncpg.Pool,
account_id: int,