Skip to content

Find the file id of a quoted picture for a video - #320

Merged
iamwavecut merged 1 commit into
mainfrom
fix/video-quoted-pictures
Dec 4, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
fix/video-quoted-pictures

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Summary

The live test of #319 failed to use the picture. In job 6001000 (/video вертикально как этот персонаж танцует гопак, sent as a reply to a picture) the bot stored the reference as {"file_id": "", "file_unique_id": "AQADLStrG3rUiEh9"}:

  • The dialog keeps quoted attachments by file_unique_id only: collect_dialog_attachments adds them first, and the full attachment from the reply is then deduplicated away.
  • getFile returned "Bad Request: file_id not specified".
  • The reference was left out, so the video was made from text alone (draw-api references=0).

Frames have the same gap, so "оживи" in a reply to a picture was affected too.

TelegramVideoFrames now takes the PostgresTelegramFileStore. When a job carries no file_id, the worker looks up latest_file_id by file_unique_id; the draw edit path resolves quoted pictures the same way. The telegram_files row for this picture exists, with an 84-character file id.

Checks

  • cargo fmt --all
  • cargo clippy -p openplotva-app --all-targets -- -D warnings
  • cargo test -p openplotva-app: 1503 passed
  • The store lookup has no unit test, because it needs Postgres. A live retry after the deploy will verify it.

The dialog knows a quoted picture only by its unique id, so a video asked
for in a reply to a picture got a reference (or frame) with an empty
file_id; getFile refused it and the video was made from text alone. The
video worker now looks the file id up in the Telegram file store when the
job carries none.
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Messages
📖 Danger checked 2 changed file(s).

Generated by 🚫 dangerJS against 3d7a540

@iamwavecut
iamwavecut merged commit d9d08d5 into main Dec 4, 2026
10 of 12 checks passed
@iamwavecut
iamwavecut deleted the fix/video-quoted-pictures branch December 4, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant