Skip to content

Commit 0e1d607

Browse files
committed
small fix on effect for "consumable" category
1 parent c4e7e7b commit 0e1d607

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/modules/category-parsers/dofus-touch/parsers/getConsumables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function categorySwitch(infoCategory, body) {
6666
case 'conditions':
6767
conditionParse(body);
6868
break;
69-
default:
70-
console.log('Sorry, we are out of ' + infoCategory + '.');
69+
// default:
70+
// console.log('Sorry, there is no: ' + infoCategory + 'or consumable without effect (in this case don\'t take attention to this msg');
7171
}
7272
}

lib/modules/category-parsers/dofus/parsers/getConsumables.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function getConsumables(url) {
2121
if (typeof $akContainer.eq(1) !== 'undefined') {
2222
$akContainer.eq(1).find('div.col-sm-6').each(function (i, element) {
2323
const infoCategory = $(this).find('div.ak-panel-title').text().trim().toLowerCase();
24-
categorySwitch(infoCategory, $(this).html());
24+
categorySwitch(infoCategory, $(this).html(), consumable);
2525
});
2626
}
2727

@@ -33,7 +33,7 @@ function getConsumables(url) {
3333
});
3434
}
3535

36-
function conditionParse(consumable, body) {
36+
function conditionParse(body, consumable) {
3737
const $ = cheerio.load(body);
3838
let condition = $('div.ak-container.ak-panel.no-padding').find('div.ak-list-element').find('div.ak-title').remove('br').text().trim();
3939
condition = sanatizer(condition);
@@ -44,7 +44,7 @@ function conditionParse(consumable, body) {
4444
consumable.conditions = conditionTab;
4545
}
4646

47-
function categorySwitch(consumable, infoCategory, body) {
47+
function categorySwitch(infoCategory, body, consumable) {
4848
switch (infoCategory) {
4949
case 'effets':
5050
consumable.statistics = effectParse(body);
@@ -53,10 +53,10 @@ function categorySwitch(consumable, infoCategory, body) {
5353
consumable.statistics = effectParse(body);
5454
break;
5555
case 'conditions':
56-
conditionParse(body);
56+
conditionParse(body, consumable);
5757
break;
58-
default:
59-
console.log('Sorry, we are out of ' + infoCategory + '.');
58+
// default:
59+
// console.log('Sorry, there is no: ' + infoCategory + 'or consumable without effect (in this case don\'t take attention to this msg');
6060
}
6161
}
6262

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dofapi/crawlit",
3-
"version": "1.6.14",
3+
"version": "1.6.15",
44
"homepage": "https://github.com/dofapi/crawlit-dofus-encyclopedia-parser",
55
"description": "Crawl structured dofus encyclopedia data to populate the Dofapi app & API",
66
"author": {

0 commit comments

Comments
 (0)