aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners
diff options
context:
space:
mode:
Diffstat (limited to 'src/cleaners')
-rw-r--r--src/cleaners/skyblock/farmingContents.ts4
-rw-r--r--src/cleaners/skyblock/objectives.ts8
-rw-r--r--src/cleaners/skyblock/stats.ts3
3 files changed, 8 insertions, 7 deletions
diff --git a/src/cleaners/skyblock/farmingContents.ts b/src/cleaners/skyblock/farmingContents.ts
index 75427ef..d8de1cf 100644
--- a/src/cleaners/skyblock/farmingContents.ts
+++ b/src/cleaners/skyblock/farmingContents.ts
@@ -35,10 +35,10 @@ export async function cleanFarmingContests(data: typedHypixelApi.SkyBlockProfile
const contestsByDate: Record<string, PlayerFarmingContestStats['crops']> = {}
for (const [contestName, contestData] of Object.entries(data.jacob2?.contests ?? {})) {
- const [year, monthDay, item] = contestName.split(':')
+ const [year, monthDay, item, itemDamage] = contestName.split(':')
const [month, day] = monthDay.split('_')
const contestByDateKey = `${year}:${month}:${day}`
- const cropId = cleanItemId(item)
+ const cropId = cleanItemId(itemDamage !== undefined ? `${item}:${itemDamage}` : item)
const cropData: PlayerFarmingContestStats['crops'][number] = {
item: cropId,
amount: contestData.collected,
diff --git a/src/cleaners/skyblock/objectives.ts b/src/cleaners/skyblock/objectives.ts
index 2443f77..62f7b8b 100644
--- a/src/cleaners/skyblock/objectives.ts
+++ b/src/cleaners/skyblock/objectives.ts
@@ -9,11 +9,11 @@ export interface Objective {
export function cleanObjectives(data: typedHypixelApi.SkyBlockProfileMember): Objective[] {
const rawObjectives = data?.objectives || {}
const objectives: Objective[] = []
- for (const rawObjectiveName in rawObjectives) {
- const rawObjectiveValue = rawObjectives[rawObjectiveName]
+ for (const [name, value] of Object.entries(rawObjectives)) {
+
objectives.push({
- name: rawObjectiveName,
- completed: rawObjectiveValue.status === 'COMPLETE',
+ name: name,
+ completed: value.status === 'COMPLETE',
})
}
return objectives
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts
index 8faec15..fc55577 100644
--- a/src/cleaners/skyblock/stats.ts
+++ b/src/cleaners/skyblock/stats.ts
@@ -1,7 +1,8 @@
import typedHypixelApi from 'typed-hypixel-api'
-const statCategories: { [key: string]: string[] | null } = { // sorted in order of importance
+// sorted in order of importance
+const statCategories: { [key: string]: string[] | null } = {
'deaths': ['deaths_', 'deaths'],
'kills': ['kills_', 'kills'],
'fishing': ['items_fished_', 'items_fished', 'shredder_'],