Skip to content

Commit 9829813

Browse files
authored
fix: proper sorting on each moebooru based (#3)
* proper sorting on each moebooru based * bump phin & cheerio
1 parent d345f7d commit 9829813

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "eiyuu",
33
"description": "Search tags and query completion for booru imageboards",
44
"funding": "https://github.com/sponsors/sinkaroid",
5-
"version": "1.1.0",
5+
"version": "1.1.1",
66
"main": "build/src/index.js",
77
"types": "build/src/index.d.ts",
88
"files": [
@@ -55,8 +55,8 @@
5555
},
5656
"homepage": "https://eiyuu.js.org",
5757
"dependencies": {
58-
"cheerio": "^1.0.0-rc.11",
59-
"phin": "^3.6.1"
58+
"cheerio": "^1.0.0-rc.12",
59+
"phin": "^3.7.0"
6060
},
6161
"devDependencies": {
6262
"@types/chai": "^4.3.1",

src/class/Eiyuu.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default class Eiyuu {
1919
private searchElements: string;
2020
private useragent: string
2121
private searchSortings: string;
22+
private searchSortingsMoebooruBased: string;
2223
private followRedirects: boolean;
2324

2425
/**
@@ -31,6 +32,7 @@ export default class Eiyuu {
3132
this.followRedirects = followRedirects || defaults.followRedirects;
3233
this.searchElements = "table.highlightable";
3334
this.searchSortings = "*&sort=desc&order_by=index_count";
35+
this.searchSortingsMoebooruBased = "*&type=&order=count";
3436

3537
this.gelbooruURL = c.GELBOORU;
3638
this.danbooruURL = c.DANBOORU;
@@ -143,7 +145,7 @@ export default class Eiyuu {
143145
public async konachan(query: string): Promise<string[]> {
144146
try {
145147
const res = await request(
146-
this.konachanURL, `*${query}`, "&type=&order=count",
148+
this.konachanURL, `*${query}`, this.searchSortingsMoebooruBased,
147149
this.useragent, this.followRedirects);
148150

149151
const $ = load(res.body);
@@ -171,7 +173,7 @@ export default class Eiyuu {
171173
public async lolibooru(query: string): Promise<string[]> {
172174
try {
173175
const res = await request(
174-
this.lolibooruURL, `*${query}`, "*&type=&order=count",
176+
this.lolibooruURL, `*${query}`, this.searchSortingsMoebooruBased,
175177
this.useragent, this.followRedirects);
176178

177179
const $ = load(res.body);
@@ -334,7 +336,7 @@ export default class Eiyuu {
334336
public async yandere(query: string): Promise<string[]> {
335337
try {
336338
const res = await request(
337-
this.yandereURL, `*${query}`, "*&type=&order=count",
339+
this.yandereURL, `*${query}`, this.searchSortingsMoebooruBased,
338340
this.useragent, this.followRedirects);
339341

340342
const $ = load(res.body);

0 commit comments

Comments
 (0)