Skip to content

Commit

Permalink
Update V1.2.2 (#7)
Browse files Browse the repository at this point in the history
* fix bug with new artifact not being scanned

* refactor scripts, remove dead code

* Revert "refactor scripts, remove dead code"

This reverts commit 1be8f9f.
  • Loading branch information
Jugbot authored Feb 18, 2024
1 parent 15bc83b commit 33fea8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "genshin-locker",
"private": true,
"productName": "genshin-locker",
"version": "1.2.1",
"version": "1.2.2",
"description": "Genshin artifact scraper and manager",
"main": "packages/main/dist/index.cjs",
"scripts": {
Expand Down
9 changes: 5 additions & 4 deletions packages/automation/src/util/scraper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ export const getSubstats = (txts: string[]): SubStat[] => {
export const getArtifactSet = (txt: string): SetKey => {
const normalizedTxt = txt.toLowerCase().replaceAll(/[^a-z]+/g, '')
const artifactData = datamine.artifacts
if (!(normalizedTxt in artifactData)) {
const artifactEntry = Object.entries(artifactData)
// Some artifact set names span multiple lines and get cut off by the scan
.find(([key]) => key.startsWith(normalizedTxt))
if (!artifactEntry) {
throw Error(`"${normalizedTxt}" not a valid artifact set`)
}
return artifactData[normalizedTxt as keyof typeof artifactData][
'GOOD'
] as SetKey
return stringToEnum(artifactEntry[1]['GOOD'], SetKey)
}
export const getStatKey = (txt: string): string => {
let normalizedTxt = txt.toLowerCase().replaceAll(/[^a-z]+/g, '')
Expand Down

0 comments on commit 33fea8e

Please sign in to comment.