2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

First version of caching in media streaming.

This commit is contained in:
John Preston
2019-02-25 21:26:08 +04:00
parent f133dd396c
commit 2208621050
15 changed files with 979 additions and 118 deletions

View File

@@ -145,11 +145,15 @@ Session::Session(not_null<AuthSession*> session)
, _cache(Core::App().databases().get(
Local::cachePath(),
Local::cacheSettings()))
, _bigFileCache(Core::App().databases().get(
Local::cacheBigFilePath(),
Local::cacheBigFileSettings()))
, _selfDestructTimer([=] { checkSelfDestructItems(); })
, _a_sendActions(animation(this, &Session::step_typings))
, _groups(this)
, _unmuteByFinishedTimer([=] { unmuteByFinished(); }) {
_cache->open(Local::cacheKey());
_bigFileCache->open(Local::cacheBigFileKey());
setupContactViewsViewer();
setupChannelLeavingViewer();
@@ -745,6 +749,10 @@ Storage::Cache::Database &Session::cache() {
return *_cache;
}
Storage::Cache::Database &Session::cacheBigFile() {
return *_bigFileCache;
}
void Session::startExport(PeerData *peer) {
startExport(peer ? peer->input : MTP_inputPeerEmpty());
}