H2Owater425 / node-hitomi

Hitomi.la api for Node.js
https://npm.im/node-hitomi
MIT License
15 stars 2 forks source link

fix: Fix 'REQUEST_REJECTED' when use 'getIds' and 'getQuriedIds', Fix 'getIds' where the results increase weird #40

Closed bass9030 closed 2 years ago

bass9030 commented 2 years ago

39 를 수정했고 hitomi.getIds(...) 사용시 endIndex가 결과값의 길이로 사용되는점을 수정했습니다.

/** Before **/

let page = 1

console.log(await hitomi.getIds({ // throw REQUEST_REJECTED
    startIndex: (page - 1) * 25,
    endIndex: (page - 1) * 25 + 24
}));
// output
// Array, length: 25

page = 2;

console.log(await hitomi.getIds({ // throw REQUEST_REJECTED
    startIndex: (page - 1) * 25,
    endIndex: (page - 1) * 25 + 24
}));
// output
// Array, length: 50

/** After **/

let page = 1

console.log(await hitomi.getIds({
    startIndex: (page - 1) * 25,
    endIndex: (page - 1) * 25 + 24
}));
// output
// Array, length: 25

page = 2;

console.log(await hitomi.getIds({
    startIndex: (page - 1) * 25,
    endIndex: (page - 1) * 25 + 24
}));
// output
// Array, length: 25
H2Owater425 commented 2 years ago

Thank you for the pull request! Since I was busy working on refactoring, I couldn't apply the updates It looks good to me, and with some changes I made, I'll release a new version of the package as soon as I can Again, thanks to contribute to this package!

PR 해주셔서 감사합니다! 리펙토링 작업을 하느라 변경사항을 이 레포에 적용 못하고 있었네요 제가 보기엔 괜찮아보이고, 제 변경사항들과 함께 최대한 빨리 새로운 버전을 출시하도록 하겠습니다 다시한번, 이 페키지에 기여해주셔서 감사합니다!