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

Commit

Permalink
Merge pull request #281 from dustinblackman/2.0.3
Browse files Browse the repository at this point in the history
2.0.3
  • Loading branch information
dustinblackman authored Mar 2, 2017
2 parents 2c88afc + 1353cb6 commit ea00cc2
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

<a name="2.0.3" />
## 2.0.3 (March 2nd, 2017)

#### Bug Fixes
- Fixed op.gg endpoints [#280](https://github.com/dustinblackman/Championify/issues/280)
- Allow imports to continue when a source is down [#276](https://github.com/dustinblackman/Championify/issues/276)
- Fixed issue with progress bar disappearing on a second import

<a name="2.0.2" />
## 2.0.2 (January 29th, 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.0.2",
"version": "2.0.3",
"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
24 changes: 21 additions & 3 deletions src/championify.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,15 @@ function downloadItemSets() {
progressbar.reset();

const to_process = [];
if (store.get('settings').aram) to_process.push(sources.lolflavor.getAram);
if (store.get('settings').aram) to_process.push({
name: 'lolflavor',
method: sources.lolflavor.getAram
});
R.forEach(source => {
if (sources[source]) to_process.push(sources[source].getSr);
if (sources[source]) to_process.push({
name: source,
method: sources[source].getSr
});
}, store.get('settings').sr_source);

Log.info(`Locale: ${T.locale}`);
Expand All @@ -207,7 +213,19 @@ function downloadItemSets() {
.then(getRiotVer)
.then(getChamps)
.then(getItems)
.then(() => Promise.all(R.map(fn => fn(), to_process)))
.then(() => Promise.all(R.map(source => {
return source.method()
.catch(err => {
Log.error(err);
store.push('undefined_builds', {
champ: 'All',
position: 'All',
source: source.name
});

return;
});
}, to_process)))
.then(deleteOldBuilds)
.then(saveToFile)
.then(resavePreferences)
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export function request(options) {
.then(res => {
if (res.statusCode >= 400) throw new ChampionifyErrors.RequestError(res.statusCode, params.url, res.body);
return res.body;
})
.catch(err => {
throw new ChampionifyErrors.RequestError(err.name, params.url, err);
});
}, retry_options);
}
Expand Down
8 changes: 4 additions & 4 deletions src/sources/opgg.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function _makeRequest(url) {
}

export function getVersion() {
return request('http://op.gg/champion/ahri/statistics/mid')
return request('https://www.op.gg/champion/ahri/statistics/mid')
.then(cheerio.load)
.then($ => R.last($('span.Small').text().split(': ')))
.tap(version => store.set('opgg_ver', version));
Expand All @@ -154,7 +154,7 @@ export function getVersion() {
export function getSr() {
if (!store.get('opgg_ver')) return getVersion().then(getSr);

return _makeRequest('http://op.gg/champion/statistics')
return _makeRequest('https://www.op.gg/champion/statistics')
.then($ => {
return $('.ChampionIndexGrid')
.find('.Item')
Expand All @@ -175,8 +175,8 @@ export function getSr() {
cl(`${T.t('processing')} op.gg: ${T.t(champ_data.name)}`);
return Promise.map(champ_data.positions, position => {
return Promise.join(
_makeRequest(`http://op.gg/champion/${champ_data.name}/statistics/${position}/item`),
_makeRequest(`http://op.gg/champion/${champ_data.name}/statistics/${position}/skill`)
_makeRequest(`https://www.op.gg/champion/${champ_data.name}/statistics/${position}/item`),
_makeRequest(`https://www.op.gg/champion/${champ_data.name}/statistics/${position}/skill`)
)
.spread(($i, $s) => {
const skills = mapSkills($s, csspaths.opgg.skills);
Expand Down
2 changes: 1 addition & 1 deletion src/view_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function mainViewBack() {
function resetMain() {
$('#cl_progress').html('');
$('.submit_btns').removeClass('hidden');
$('.status').attr('class', 'status hidden');
$('.status').attr('class', 'status');
_initSettings();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/sources/opgg.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function testWithFixture(fixture) {

describe('src/sources/opgg', () => {
before(() => {
nocked = nock('http://op.gg');
nocked = nock('https://www.op.gg');
});

beforeEach(() => {
Expand Down

0 comments on commit ea00cc2

Please sign in to comment.