mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-16 02:48:08 -04:00
Fix for chunks behaving incorrectly on loss of internet connection #323
This commit is contained in:
parent
1871d7b477
commit
1750fa90b1
@ -25,12 +25,12 @@ public class ChunkUtils {
|
||||
String range;
|
||||
if (currentRange + CHUNK_SIZE >= contentLength) {
|
||||
range = String.format("%d-", currentRange);
|
||||
currentRange += CHUNK_SIZE + 1;
|
||||
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, contentLength));
|
||||
currentRange += CHUNK_SIZE + 1;
|
||||
} else {
|
||||
range = String.format("%d-%d", currentRange, currentRange + CHUNK_SIZE);
|
||||
currentRange += CHUNK_SIZE + 1;
|
||||
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, currentRange + CHUNK_SIZE));
|
||||
currentRange += CHUNK_SIZE + 1;
|
||||
}
|
||||
}
|
||||
return chunks;
|
||||
|
Loading…
x
Reference in New Issue
Block a user