Skip to content

Commit

Permalink
fix: GenericDownloadIter offset bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dcdunkan committed Feb 2, 2023
1 parent c988d8f commit 7614486
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/client/downloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ export class GenericDownloadIter extends DirectDownloadIter {
let data = Buffer.alloc(0);

// 1.1. ``bad`` is how much into the data we have we need to offset
const bad = this.request!.offset.divide(
this.request!.limit,
).toJSNumber();
const bad = this.request!.offset.mod(this.request!.limit).toJSNumber();
const before = this.request!.offset;

// 1.2. We have to fetch from a valid offset, so remove that bad part
Expand Down

0 comments on commit 7614486

Please sign in to comment.