fix(backend,frontend): expired story keeps its kind and archive heals stories that lost it, phone inputs no longer zoom the page
This commit is contained in:
1 parent
d9378056f4
commit
acfa726e61
7 files changed
+69
-9
No files matched your search
@@ -17,13 +17,18 @@ def story_peer_id(story: Story) -> int:
|
||||
|
||||
async def save_story(client: Client, capture: CaptureContext, story: Story) -> None:
|
||||
peer_id = story_peer_id(story)
|
||||
if story.deleted:
|
||||
await repository.mark_deleted(
|
||||
capture.pool, capture.account_id, peer_id, story.id
|
||||
)
|
||||
return
|
||||
storage_key: str | None = None
|
||||
file_size: int | None = None
|
||||
downloaded = False
|
||||
stored = await repository.is_downloaded(
|
||||
capture.pool, capture.account_id, peer_id, story.id
|
||||
)
|
||||
if not (stored or story.deleted or story.media is None):
|
||||
if not (stored or story.media is None):
|
||||
data = await download_bytes(client, story)
|
||||
if data is not None:
|
||||
storage_key = capture.storage.put(data)
|
||||
@@ -43,6 +48,5 @@ async def save_story(client: Client, capture: CaptureContext, story: Story) -> N
|
||||
story.views,
|
||||
raw_json(story.raw),
|
||||
pinned=bool(story.pinned),
|
||||
deleted=bool(story.deleted),
|
||||
downloaded=downloaded,
|
||||
)
|
||||
Reference in new issue
Block a user