From 7181ec69d38f7b4f9c469f7d8b429eafbb1b9dc2 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 15 Jul 2016 07:04:45 +0200 Subject: [PATCH] Using a special downloaderClient for fiel downloads. --- .../de/fabianonline/telegram_backup/DownloadManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java b/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java index 0b0cafc..05035fb 100644 --- a/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java +++ b/src/main/java/de/fabianonline/telegram_backup/DownloadManager.java @@ -53,6 +53,7 @@ public class DownloadManager { TelegramClient client; Database db; DownloadProgressInterface prog = null; + static TelegramClient download_client; public DownloadManager(UserManager u, TelegramClient c, DownloadProgressInterface p) { this.user = u; @@ -189,6 +190,7 @@ public class DownloadManager { } public void downloadMedia() throws RpcErrorException, IOException { + download_client = client.getDownloaderClient(); boolean completed = true; do { completed = true; @@ -290,9 +292,9 @@ public class DownloadManager { Log.debug("offset: %8d block_size: %7d size: %8d", offset, block_size, size); TLRequestUploadGetFile req = new TLRequestUploadGetFile(loc, offset, block_size); if (dcID==null) { - response = (TLFile) client.executeRpcQuery(req); + response = (TLFile) download_client.executeRpcQuery(req); } else { - response = (TLFile) client.executeRpcQuery(req, dcID); + response = (TLFile) download_client.executeRpcQuery(req, dcID); } offset += response.getBytes().getData().length;