telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.38k stars 5.24k forks source link

Limit automatic media download only to currently opened chat / Optimize cache (discard thumbs, avatars, etc) #5448

Open reallyuniquename opened 5 years ago

reallyuniquename commented 5 years ago

Steps to reproduce

  1. Settings -> Advanced -> Automatic media download
  2. Uncheck all checkboxes
  3. Open any channel or group with images
  4. Scroll through chat/channel
  5. All images are blurry and NOT loaded untill user manually clicks on them

Expected behaviour

I expect all background (not currently opened) groups/channels NOT to load any media EXCEPT the one I'm actually scrolling through i.e. the one I'm reading.

Actual behaviour

All background (not currently opened) groups/channels do NOT load any media INCLUDING the one I'm actually scrolling through i.e. the one I'm reading.

Details

I'm subscribed to really noisy media channels and groups which I rarely check.

Telegram trashes my HDD by downloading dozens of pictures every second from channels I haven't even opened. I get 10000+ cache files in a matter of hours and I keep Telegram running 24/7. Cache limit option doesn't really help because it just keeps overwriting files.

If I turn off automatic media download then it's disabled even for the group I'm actually reading. It's extremely annoying.

Configuration

Operating system: Windows 7

Version of Telegram Desktop: 1.4.3

Used theme: default

john-preston commented 5 years ago

@reallyuniquename Telegram doesn't load photos from chats you didn't open. Automatic media download settings should have effect only on the objects that were displayed on your screen.

reallyuniquename commented 5 years ago

@john-preston wait, what?

I just launched Telegram with empty cache. Media auto download is enabled only for photos. I opened one single slow text-only chat group and minimized Telegram for half an hour.

Then I checked cache status: clipboard_20181207

It was still increasing.

Folder \tdata\user_data\cache\ keeps growing with files even when nothing is posted in the opened chat.

What am I missing?

john-preston commented 5 years ago

@reallyuniquename I'll need to check that. Some images are loaded anyway, like userpics and thumbnails, but 19 MB is too much for them.

reallyuniquename commented 5 years ago

@john-preston Thanks!

Some images are loaded anyway, like userpics and thumbnails

Ah this is it I guess. So Telegram does download thumbs for everything posted in background channels. Is there any way to disable it?

19 MB is too much for them

Size may vary. Most of the time it's about 3MB per 1000 images. Size does not really concern me since cache is limited to 100MB via settings anyway. The real issue is constant trashing of the hard drive with thousands of files.

john-preston commented 5 years ago

@reallyuniquename Thumbs are loaded even if autodownload is disabled :(

reallyuniquename commented 5 years ago

@john-preston Ouch, you are right. Any chance to mark this behaviour as a bug or at least request a feature that will allow to disable it?

clipboard_20181207 2 This is just 5 seconds with Telegram running without any opened chats. By the end of the day there will be thousands of downloaded files which are basically useless.

john-preston commented 5 years ago

@reallyuniquename Perhaps some day the local cache engine will be optimized so that it could save all small files to a single file, one after another, but I'm not sure this will happen anytime soon.

Not downloading thumbnails at all right now is not supported, and they're often are even inserted in the messages themselves, because the messages list looks bad without them. And if we receive such data it will be a bad idea to just throw it away, without saving.

samsong commented 4 years ago

2nd this request. Alternative solution could be separate images into folders - "channels", "users", "groups" Member of a few groups and have thousands of telegram photos from the groups which are useless. Cannot separate them from direct 1-1 user/friend photos

EDIT: this feature has been added to telegram android client which is great. Not sure about desktop though

Aokromes commented 4 years ago

I suggested that here https://github.com/telegramdesktop/tdesktop/issues/5788

reallyuniquename commented 4 years ago

@samsong That feature you are talking about was implemented in Telegram Desktop too but it's actually not related to this issue. The underlying problem is cache engine that downloads and stores media like thumbnails or userpics from chats you haven't even opened (hundreds of small files per hour).

I should probably edit my original post.

stale[bot] commented 4 years ago

Hey there!

This issue will be automatically closed in 7 days if there would be no activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

reallyuniquename commented 4 years ago

Yes, cache engine needs some love and optimization.

stale[bot] commented 3 years ago

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

reallyuniquename commented 3 years ago

Valid.