Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
2.1.4
Browse files Browse the repository at this point in the history
Fixes #382
  • Loading branch information
Dustin Blackman committed Jan 29, 2018
1 parent ad28fb2 commit 3a00beb
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 73 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

<a name="2.1.4" />
## 2.1.4 (January 29th, 2018)

#### Bug Fixes
- Fixed Probuilds not downloading any item sets. [#382](https://github.com/dustinblackman/Championify/issues/382)
- Fixed cursor type on footer links. [#383](https://github.com/dustinblackman/Championify/pull/383) (Thanks [mnlkrs](https://github.com/mnlkrs))

<a name="2.1.3" />
## 2.1.3 (November 22nd, 2017)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Championify",
"version": "2.1.3",
"version": "2.1.4",
"description": "Downloads all the recent builds from websites like Champion.gg and imports them in to League of Legends.",
"main": "electron.js",
"scripts": {
Expand Down
27 changes: 8 additions & 19 deletions src/sources/probuilds.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,15 @@ export const source_info = {
};

function getChamps() {
return request('http://probuilds.net/champions')
.then(cheerio.load)
.then($ => {
return $('.champ-image')
.map((idx, el) => $(el).attr('data-id').split('|')[0])
.get();
});
return request({url: 'http://probuilds.net/ajax/championListNew', json: true})
.then(R.prop('champions'))
.map(R.prop('key'));
}

function getIDs($, el) {
return el.find('.item')
return arrayToBuilds(el.find('.item.tooltip')
.map((idx, entry) => $(entry).attr('data-id'))
.get();
}

function mergeIDs($, divs, start_point) {
return arrayToBuilds(R.concat(
getIDs($, divs.eq(start_point)),
getIDs($, divs.eq(start_point + 1))
));
.get());
}

function getTopKDAItems(champ) {
Expand Down Expand Up @@ -93,9 +82,9 @@ function getItems(champ_case) {
getTopKDAItems(champ)
)
.spread(($, kda) => {
const divs = $('.popular-items').find('div.left');
const core = mergeIDs($, divs, 0);
const boots = mergeIDs($, divs, 2);
const divs = $('.popular-section');
const core = getIDs($, divs.eq(0));
const boots = getIDs($, divs.eq(2));

const riot_json = R.merge(default_schema, {
champion: champ,
Expand Down
2 changes: 1 addition & 1 deletion tests/sources/fixtures/probuilds/responses/ahri.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tests/sources/fixtures/probuilds/responses/champions.html

This file was deleted.

1 change: 1 addition & 0 deletions tests/sources/fixtures/probuilds/responses/champions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"champions": [{"key":"Ahri"}]}
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
10 changes: 5 additions & 5 deletions tests/sources/fixtures/probuilds/results/ahri_result_locksr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"count": 1
},
{
"id": "3135",
"id": "3285",
"count": 1
},
{
"id": "3116",
"id": "3135",
"count": 1
},
{
"id": "3089",
"id": "3146",
"count": 1
},
{
"id": "3001",
"id": "3152",
"count": 1
},
{
"id": "3285",
"id": "3089",
"count": 1
}
],
Expand Down
2 changes: 1 addition & 1 deletion tests/sources/probuilds.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('src/sources/probuilds', () => {
store.set('settings', {});
nock.cleanAll();
nocked
.get('/champions')
.get('/ajax/championListNew')
.reply(200, RESPONSES_FIXTURES.champions)
.get('/champions/details/Ahri')
.reply(200, RESPONSES_FIXTURES.ahri)
Expand Down

0 comments on commit 3a00beb

Please sign in to comment.