Fix for chunks behaving incorrectly on loss of internet connection #323

This commit is contained in:
mhutti1 2016-09-26 11:25:07 +01:00
parent 1871d7b477
commit 1750fa90b1

View File

@ -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;