Skip to content

Commit 17387ef

Browse files
ted423Rhilip
authored andcommitted
feat(HDB): support search seed status
1 parent 18b9b08 commit 17387ef

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

resource/sites/hdbits.org/config.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,20 @@
5252
"name": "IMDB",
5353
"keyAutoMatch": "^(tt\\d+)$",
5454
"queryString": "imdb=$key$"
55-
}]
55+
}],
56+
"fieldSelector": {
57+
"progress": {
58+
"selector": ["span.tag.tag_seeding,span.tag.tag_completed"],
59+
"filters": ["query.length > 0?100:null"]
60+
},
61+
"status": {
62+
"selector": ["span.tag.tag_seeding", "span.tag.tag_completed"],
63+
"switchFilters": [
64+
["2"],
65+
["255"]
66+
]
67+
}
68+
}
5669
},
5770
"searchEntry": [{
5871
"name": "全部",

resource/sites/hdbits.org/getSearchResult.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
// 用于定位每个字段所列的位置
3535
let fieldIndex = {
36+
progress: 2,
37+
status: 2,
3638
// 时间
3739
time: 4,
3840
// 大小
@@ -51,7 +53,7 @@
5153
category: 0
5254
};
5355
if(rows.eq(0).find("td[id*=codec]").length == 0) {
54-
fieldIndex = {time: 3,size: 4,seeders: 6,leechers: 7,completed: 5,name: 1,author: 8,category: 0};
56+
fieldIndex = {progress: 1,status: 1,time: 3,size: 4,seeders: 6,leechers: 7,completed: 5,name: 1,author: 8,category: 0};
5557
}
5658
if (site.url.substr(-1) == "/") {
5759
site.url = site.url.substr(0, site.url.length - 1);
@@ -117,7 +119,9 @@
117119
site: site,
118120
entryName: options.entry.name,
119121
category: this.getCategory(cells.eq(fieldIndex.category)),
120-
tags: Searcher.getRowTags(site, row)
122+
tags: Searcher.getRowTags(site, row),
123+
progress: Searcher.getFieldValue(site, cells.eq(fieldIndex.progress), "progress"),
124+
status: Searcher.getFieldValue(site, cells.eq(fieldIndex.status), "status")
121125
};
122126
results.push(data);
123127
}

0 commit comments

Comments
 (0)