Browse Source

Downloading: use smaller chunks

master
Eduard Kuzmenko 3 years ago
parent
commit
02c91039d0
  1. 8
      src/lib/mtproto/apiFileManager.ts

8
src/lib/mtproto/apiFileManager.ts

@ -257,14 +257,16 @@ export class ApiFileManager { @@ -257,14 +257,16 @@ export class ApiFileManager {
}
private getLimitPart(size: number): number {
let bytes: number;
let bytes = 128 * 1024;
bytes = 512;
while((size / bytes) > 2000) {
bytes *= 2;
}
/* if(size < 1e6 || !size) bytes = 512;
else if(size < 3e6) bytes = 256;
else bytes = 128; */
return bytes * 1024;
return bytes;
}
private uncompressTGS = (bytes: Uint8Array, fileName: string) => {

Loading…
Cancel
Save