@@ -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
0 commit comments