[Feat] Option to preserve or override file modification time for downloads (to ensure Jellyfin showing them in Recently Added sections)
Proposal
Add a configuration option (e.g. --update-mtime or --use-upload-time) to let users choose which timestamp to apply when downloading files:
Option 1: --use-upload-time Keep Telegram’s upload time (current behavior)
Option 2: --update-mtime Use the local download time (previous behavior)
This would allow better compatibility with media managers and file indexing tools that rely on local modification times.
Background
After a recent update, I noticed that the downloaded files’ modification time (mtime) now matches the original upload time on Telegram, rather than the time the file was downloaded locally.
This causes an issue with media servers like Jellyfin, which determine “Recently Added” items based on the file’s modification or creation time.
# Before update
$ ls -l video.mp4
-rw-r--r-- 1 user user 100M Nov 2 12:30 video.mp4 ← download time
# After update
-rw-r--r-- 1 user user 100M Oct 25 21:15 video.mp4 ← Telegram upload time
As a result, newly downloaded files no longer appear in Jellyfin’s “Recently Added” section on the home page, and now viewing them requires more time and effort for clicking, typing, and searching, given that there is a number of libraries and folders.
Thanks for considering this feature — it would greatly improve integration with media servers like Jellyfin.
Workarounds
The only workaround I can think of is downgrading to the old version, because Jellyfin (and I assume other media servers as well) checks mtime by defualt.
I tend to accept this feature request. What's your options? @iyear @Fengzdadi
LGTM