mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 16:37:23 +00:00
add loadNext
to search
This commit is contained in:
@@ -334,6 +334,18 @@ class NewComicSource extends ComicSource {
|
|||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* load search result with next page token.
|
||||||
|
* The field will be ignored if `load` function is implemented.
|
||||||
|
* @param keyword {string}
|
||||||
|
* @param options {(string)[]} - options from optionList
|
||||||
|
* @param next {string | null}
|
||||||
|
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
||||||
|
*/
|
||||||
|
loadNext: async (keyword, options, next) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
// provide options for search
|
// provide options for search
|
||||||
optionList: [
|
optionList: [
|
||||||
{
|
{
|
||||||
|
@@ -397,13 +397,13 @@ class Ehentai extends ComicSource {
|
|||||||
/// search related
|
/// search related
|
||||||
search = {
|
search = {
|
||||||
/**
|
/**
|
||||||
* load search result
|
* load search result with next page token
|
||||||
* @param keyword {string}
|
* @param keyword {string}
|
||||||
* @param options {(string)[]} - options from optionList
|
* @param options {(string)[]} - options from optionList
|
||||||
* @param page {number}
|
* @param next {string | null}
|
||||||
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
||||||
*/
|
*/
|
||||||
load: async (keyword, options, page) => {
|
loadNext: async (keyword, options, next) => {
|
||||||
let category = JSON.parse(options[0]);
|
let category = JSON.parse(options[0]);
|
||||||
let stars = options[1];
|
let stars = options[1];
|
||||||
let language = options[2];
|
let language = options[2];
|
||||||
@@ -421,7 +421,7 @@ class Ehentai extends ComicSource {
|
|||||||
if(stars) {
|
if(stars) {
|
||||||
url += `&f_srdd=${stars}`
|
url += `&f_srdd=${stars}`
|
||||||
}
|
}
|
||||||
return this.getGalleries(url, false);
|
return this.getGalleries(next ?? url, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
// provide options for search
|
// provide options for search
|
||||||
|
Reference in New Issue
Block a user