Skip to content

Commit

Permalink
(New) ItemSet fixes
Browse files Browse the repository at this point in the history
- ItemSetHandler#parse does only parsing from now on.
- Fixed ItemSet parsing
- Incremented version
  • Loading branch information
Ryzzzen committed Aug 9, 2018
1 parent bee3a81 commit 63773f6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions objects/ChampionSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ class ChampionSelect extends EventEmitter {

Mana.status(`Saving ${data.itemsets.length} ItemSets for ${champion.name} (${this.value})`);

for (const set of data.itemsets) {
console.dir(set._data);
for (const set of data.itemsets)
await set.save();
}
}
catch(err) {
UI.error(err);
Expand Down
4 changes: 1 addition & 3 deletions objects/handlers/ItemSetHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ const { ItemSet, Block } = require('../ItemSet');

class ItemSetHandler {

static async parse(key, obj) {
if (typeof obj === 'string') obj = await ItemSetHandler._readFile(obj);

static parse(key, obj) {
let set = new ItemSet(key);
set._data = obj;

Expand Down
6 changes: 3 additions & 3 deletions objects/handlers/ProviderHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class ProviderHandler {
if (Mana.store.has(`data.${champion.key}`)) {
let data = Mana.store.get(`data.${champion.key}`);

for (let [position, data] of Object.entries(data))
for (let i = 0; i < data.itemsets.length; i++)
data.itemsets[i] = require('./ItemSetHandler').parse(champion.key, data.itemsets[i]._data);
for (let x in data)
for (let i = 0; i < data[x].itemsets.length; i++)
console.dir(data[x].itemsets[i] = require('./ItemSetHandler').parse(champion.key, data[x].itemsets[i]._data));

return data;
}
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": "manaflux",
"version": "1.4.1",
"version": "1.4.2",
"description": "League of Legends automatic runes downloader",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 63773f6

Please sign in to comment.