3bl3gamer / tg_history_dumper

Exports messages and media from Telegram dialogs, groups and channels
MIT License
69 stars 13 forks source link

Preview: add simple pagination for huge chats #34

Closed pmurzakov closed 3 months ago

pmurzakov commented 3 months ago

Hi!

Chats containing a lot of messages are very difficult to handle for the browser especially if there are also a lot of media within the messages. I've added simple pagination in order to tackle this. Default limit 10000 was chosen empirically as some sort of a tradeoff, it can be overridden via "limit" GET-parameter which is kept through pagination. Previous behaviour can be restored passing limit=0 as a GET-parameter.

Though there is a room for further optimisation to avoid parsing JSON-lines outside of current page window, it was left behind the scope of current PR.