Skip to content

Commit

Permalink
OP.GG: added support for maintenance, added new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzzzen committed Feb 10, 2019
1 parent e1753f6 commit 8410346
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion objects/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
"providers-downloader-saving-status": "Saving everything to hard drive",
"providers-downloader-window-closed": "The window has been closed. Data will now be saved.",
"providers-error-item-sets-not-found": "Could not find Item Sets",
"providers-error-outdated": "%s: Data is outdated!",
"providers-error-outdated": "%s: Outdated data!",
"providers-error-offline": "%s is offline right now.",
"providers-error-perks": "Could not gather perks for %s (%s)",
"providers-flux-uploading": "Uploading data to Flu.x",
"providers-flux-upload-error": "Couldn't upload data to Flu.x",
Expand Down
1 change: 1 addition & 0 deletions objects/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"providers-downloader-window-closed": "La fenêtre à été fermée. Les données vont maintenant se sauvegarder.",
"providers-error-item-sets-not-found": "Impossible de trouver un set d'objet",
"providers-error-outdated": "%s: les données ne sont pas à jour pour le dernier patch",
"providers-error-offline": "%s est hors-ligne.",
"providers-error-perks": "Could not gather runes for %s (%s)",
"providers-flux-uploading": "Téléversement des données vers Flu.x",
"providers-flux-upload-error": "Une erreur est survenue lors du téléversement",
Expand Down
5 changes: 2 additions & 3 deletions objects/providers/OPGG.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ class OPGGProvider extends Provider {
}

_scrape(html, champion, gameMode, position, firstScrape) {
let $ = cheerio.load(html);

const convertOPGGPosition = this.convertOPGGPosition;
let $ = cheerio.load(html), convertOPGGPosition = this.convertOPGGPosition;

if ($('.champion-stats-header-version').text().trim().slice(-4) != Mana.gameClient.branch) UI.error('providers-error-outdated', this.name);
if ($('.WorkingTitle').text().trim().startsWith('Maintenance')) UI.error('providers-error-offline', this.name);

position = $('li.champion-stats-header__position.champion-stats-header__position--active').data('position') ? this.convertOPGGPosition($('li.champion-stats-header__position.champion-stats-header__position--active').data('position')).toUpperCase() : position;
const availablePositions = [];
Expand Down

0 comments on commit 8410346

Please sign in to comment.