mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-17 11:25:34 -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;
|
String range;
|
||||||
if (currentRange + CHUNK_SIZE >= contentLength) {
|
if (currentRange + CHUNK_SIZE >= contentLength) {
|
||||||
range = String.format("%d-", currentRange);
|
range = String.format("%d-", currentRange);
|
||||||
currentRange += CHUNK_SIZE + 1;
|
|
||||||
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, contentLength));
|
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, contentLength));
|
||||||
|
currentRange += CHUNK_SIZE + 1;
|
||||||
} else {
|
} else {
|
||||||
range = String.format("%d-%d", currentRange, currentRange + CHUNK_SIZE);
|
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));
|
chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, currentRange + CHUNK_SIZE));
|
||||||
|
currentRange += CHUNK_SIZE + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return chunks;
|
return chunks;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user