fix(route): fixes "this route is empty" for copymanga (#8960)
* fix(route): fixes "this route is empty" for copymanga This fix mirrors manhuagui logic updated in [1] - returns all items when chapterCnt is 0 or not specified. [1] https://github.com/DIYgod/RSSHub/pull/8670 * Add myself to `author` in docs/ This helps refactoring routes to v2. See https://github.com/DIYgod/RSSHub/pull/8960#issuecomment-1030617999 * Add more authors Ref: #8670 Co-authored-by: Tony <TonyRL@users.noreply.github.com> Co-authored-by: Tony <TonyRL@users.noreply.github.com>
This commit is contained in:
parent
5326d9f751
commit
d08f662103
|
|
@ -443,7 +443,7 @@ Sources
|
|||
|
||||
### 漫画更新
|
||||
|
||||
<Route author="btdwv" path="/copymanga/comic/:id/:chapterCnt?" example="/copymanga/comic/zaiyishijiemigongkaihougong/5" :paramsDesc="['漫画ID','返回章节的数量,默认为0,返回所有章节']" radar="1" rssbud="1"/>
|
||||
<Route author="btdwv marvolo666 yan12125" path="/copymanga/comic/:id/:chapterCnt?" example="/copymanga/comic/zaiyishijiemigongkaihougong/5" :paramsDesc="['漫画ID','返回章节的数量,默认为0,返回所有章节']" radar="1" rssbud="1"/>
|
||||
|
||||
## 漫画 DB
|
||||
|
||||
|
|
|
|||
|
|
@ -59,10 +59,16 @@ module.exports = async (ctx) => {
|
|||
`.trim(),
|
||||
});
|
||||
|
||||
let itemsLen = chapterArray.length;
|
||||
|
||||
if (chapterCnt > 0) {
|
||||
itemsLen = chapterCnt;
|
||||
}
|
||||
|
||||
ctx.state.data = {
|
||||
title: `拷贝漫画 - ${bookTitle}`,
|
||||
link: `https://copymanga.com/comic/${id}`,
|
||||
description: bookIntro,
|
||||
item: chapterArray.map(genResult).slice(0, chapterCnt),
|
||||
item: chapterArray.map(genResult).slice(0, itemsLen),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue