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

Commit

Permalink
Merge branch 'speedrank' of git://github.com/drgoonic/ffrkbot
Browse files Browse the repository at this point in the history
  • Loading branch information
brasstax committed Jan 16, 2019
2 parents 64e3042 + 228c4d0 commit 11653c1
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions utilities/speedrank-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,26 +162,29 @@ exports.speedrank = function lookupspeedrank(
**/
function getSheet(category, secondaryCategory) {
let version = "Overall";
if (secondaryCategory === 'no-csb'){

// check for various permutations of "No CSB"
if (['no-csb','nocsb','no','no csb'].includes(secondaryCategory.toLowerCase())){
version = 'No CSB';
}
switch (category) {
case '3star':
category = `GL 3* ${version} rankings`;
break;
case '4star':
category = `GL 4* ${version} rankings`;
break;
case '5star':
//category = 'GL 5* '+version+ ' rankings';
category = `GL 5* ${version} rankings`;
break;
case 'torment':
category = 'Torment';
break;
default:
category = 'Error';
}

// check for various permutations of fight, e.g. "4 star", "Torment" and convert to sheet name
if (['3','3star','3-star','3 star'].includes(category.toLowerCase())){
category = `GL 3* ${version} rankings`;
}
else if (['4','4star','4-star','4 star'].includes(category.toLowerCase())){
category = `GL 4* ${version} rankings`;
}
else if (['5','5star','5-star','5 star'].includes(category.toLowerCase())){
category = `GL 5* ${version} rankings`;
}
else if (['torment', 'tor', 'neotorment', 'neo'].includes(category.toLowerCase())){
category = 'Torment';
}
else{
category = 'Error';
}

return category;
}
/**
Expand Down

0 comments on commit 11653c1

Please sign in to comment.