You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Background media download in the daemon, with a disk quota #99
tg media download (#22) fetches one attachment when asked, and the daemon downloads nothing. To keep the files of chosen chats on disk without asking each time, the daemon has to download in the background.
Proposed:
Download rules per chat type and media kind, with a size limit (for example photos and voice messages up to 10 MB in DMs). Off by default.
A download queue per account: a manual download goes first, a concurrency limit applies, and the queue shares FLOOD_WAITs and connections with sync jobs.
A disk quota per account for downloaded media. The least recently used files go first; pinned chats or files stay.
tg status shows the queue and the media size against the quota.
Questions:
The daemon is read-only: it never sends, edits or deletes. Downloading only reads from Telegram, but Send and download media #22 said the daemon downloads nothing, so this changes a documented rule.
How the queue survives a restart and resumes partial files.
Where per-file state (last access, pins) lives, next to the account's cache.
Done when e2e tests with a mocked client show the rules pick the right messages, the quota evicts the least recently used files and keeps pinned ones, and a short live daemon run downloads a new voice message in a test chat.
Activity