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 #204 from dustinblackman/cleanup
Browse files Browse the repository at this point in the history
v1.3.4
  • Loading branch information
dustinblackman committed Jul 28, 2016
2 parents f44bc1a + bb312c3 commit ad796d0
Show file tree
Hide file tree
Showing 26 changed files with 135 additions and 108 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

<a name="1.3.4" />
### 1.3.4 (July 28th, 2016)

#### Bug Fixes
- Lolflavor is dead, remove from the app
- Verify sources exist in code base before processing
- Fix KoreanBuilds scraper to show proper titles and split blocks
- Add trinkets to Korean Builds
- Fix missing blue trinket from all item sets

<a name="1.3.3" />
### 1.3.3 (April 6th, 2016)

Expand Down
56 changes: 7 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,57 +45,15 @@ Found [here](https://github.com/dustinblackman/Championify/releases/latest)

## [Change Log](CHANGELOG.md)

<a name="1.3.3" />
### 1.3.3 (April 6th, 2016)

#### Notes
- Disabled LeagueOfGraphs

<a name="1.3.2" />
### 1.3.2 (April 6th, 2016)

#### Bug Fixes
- Fixed bug when install path isn't correctly set and throws an error instead of a warning
- Fixed health pots missing
- Fixed duplicate items

<a name="1.3.1" />
### 1.3.1 (April 6th, 2016)

#### Bug Fixes
- Fix preferences not being loaded correctly after updating.

<a name="1.3.0" />
### 1.3.0 (April 6th, 2016)

#### Features
- Added KoreanBuilds and LeagueOfGraphs as sources
- Download multiple sources at once instead of just one
- New logo by Omer Levy (cause yeah, pretty is a feature)
- Updated latest translation
<a name="1.3.4" />
### 1.3.4 (July 28th, 2016)

#### Bug Fixes
- Fixed skills sometimes broken on certain champs (Kha'Zix for example)
- Fixed various bugs with languages
- Added missing consumables
- Fixed sentences in specific languages being too long and pushing rows too far down
- Progress bar is more accurate

#### Technical Features
- Complete refactor
- Dropped Coffeescript, Lodash, and Async for ES6, Ramda, and Bluebird
- Dropped Bower
- Fixed development on Windows, `npm run dev` now works on both OSX and Windows
- Code consistency to follow new styling guidelines
- Removed anything that uses `window` for it's own module
- Updated electron to 0.35.4 (still uses Node 4)
- Improved error handling
- Improved logging
- Status view now shows in the full app (and scrolls like it did before)
- New sources can now be dropped in and the app will handle the rest (see CONTRIBUTE.md)
- Shrunk build size by 5MBs (deep cleaning of `node_modules` folder)
- Removed a bunch of unused/unneeded packages
- Docs written for the entire app to make contributing easier
- Lolflavor is dead, remove from the app
- Verify sources exist in code base before processing
- Fix KoreanBuilds scraper to show proper titles and split blocks
- Add trinkets to Korean Builds
- Fix missing blue trinket from all item sets


## Idea/Suggestions
Expand Down
4 changes: 1 addition & 3 deletions data/prebuilts.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],

"consumables": [
{
"id": "2003",
Expand Down Expand Up @@ -53,7 +52,6 @@
}

],

"trinket_upgrades": [
{
"id": "3361",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Championify",
"version": "1.3.3",
"version": "1.3.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 All @@ -10,7 +10,8 @@
"build-artifact": "gulp build-artifact",
"coveralls": "gulp coveralls",
"dev": "gulp dev",
"lint": "gulp lint"
"lint": "gulp lint",
"release": "gulp release"
},
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion src/championify.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ function downloadItemSets() {
progressbar.reset();

const toProcess = [];
R.forEach(source => toProcess.push(sources[source].getSr), store.get('settings').sr_source);
R.forEach(source => {
if (sources[source]) toProcess.push(sources[source].getSr);
}, store.get('settings').sr_source);

return saveSettings()
.then(permissions.championTest)
Expand Down
13 changes: 10 additions & 3 deletions src/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ class Preferences {
load() {
const preference_file = this.file();
if (fs.existsSync(preference_file)) {
const prefs = JSON.parse(fs.readFileSync(preference_file));
let prefs = {};
const rawprefs = fs.readFileSync(preference_file);
try {
prefs = JSON.parse(rawprefs);
} catch (err) {
Log.warn('Unable to parse preferences');
Log.warn(rawprefs);
Log.warn(err);
}
if (!prefs.prefs_version || semver.lt(prefs.prefs_version, '1.3.3')) return null;
return prefs;
}
Expand Down Expand Up @@ -108,8 +116,7 @@ class Preferences {
trinkets_position: trinkets_position,
locksr: $('#options_locksr').is(':checked'),
sr_source: $('#options_sr_source').val().split(','),
dontdeleteold: $('#options_dontdeleteold').is(':checked'),
aram: $('#options_aram').is(':checked')
dontdeleteold: $('#options_dontdeleteold').is(':checked')
}
};
}
Expand Down
30 changes: 21 additions & 9 deletions src/sources/koreanbuilds.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import store from '../store';
import T from '../translate';

const default_schema = require('../../data/default.json');
const prebuilts = require('../../data/prebuilts.json');


export const source_info = {
Expand Down Expand Up @@ -80,9 +81,14 @@ export function getSr() {
.then(cheerio.load)
.then($c => {
// Item sets
const items = $c('.item')
.map((idx, elem) => $c(elem).children().attr('src').match(/([^\/]+)(?=\.\w+$)/)[0])
.get();
function getItems(idx) {
return $c('#items').find('.float').eq(idx).find('.item')
.map((idx, elem) => $c(elem).children().attr('src').match(/([^\/]+)(?=\.\w+$)/)[0])
.get();
}

const items = getItems(0);
const early_items = R.concat(R.pluck('id', prebuilts.trinkets), getItems(1));

// Skills
let skills = [];
Expand All @@ -108,12 +114,18 @@ export function getSr() {
skills = skills.join('.');
}

const games_played = $c('p').eq(3).text().split(' ')[0];
const stats = $c('p').eq(2).text().slice(6);
const block = [{
items: _arrayToBuilds(items),
type: `${stats} - ${games_played} ${T.t('games_played', true)}`
}];
const games_played = $c('p').eq(4).text().split(' ')[0];
const stats = $c('p').eq(2).text().split(': ')[1];
const block = [
{
items: _arrayToBuilds(early_items),
type: `${T.t('starter', true)} - ${stats} - ${games_played} ${T.t('games_played', true)}`
},
{
items: _arrayToBuilds(items),
type: T.t('core_items', true)
}
];

const riot_json = R.merge(R.clone(default_schema, true), {
champion: champ_data.name,
Expand Down
1 change: 1 addition & 0 deletions stylesheets/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
span
color $text_color
font-weight bold
padding-left 3px


// Submit/Progress
Expand Down
4 changes: 2 additions & 2 deletions tests/sources/fixtures/championgg/responses/brand.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -209,7 +209,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -238,7 +238,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -168,7 +168,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -197,7 +197,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -127,7 +127,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -156,7 +156,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -127,7 +127,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -156,7 +156,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -209,7 +209,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -238,7 +238,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -94,7 +94,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -168,7 +168,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down Expand Up @@ -242,7 +242,7 @@
"count": 1
},
{
"id": "3342",
"id": "3363",
"count": 1
}
],
Expand Down
Loading

0 comments on commit ad796d0

Please sign in to comment.