Skip to content

Commit b052331

Browse files
authored
fixed tail filter
1 parent f14e867 commit b052331

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ships/gallery.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,13 @@ const handleSkinCategory = ({
9292
const ICON_URL_TAILS = {
9393
"Icon.png": "icon",
9494
"ChibiIcon.png": "chibi",
95-
"Banner.png": "banner",
96-
"default": "unknown"
95+
"Banner.png": "banner"
9796
};
9897

9998
function parseIcons(td: Element){
10099
return Array.from(td.querySelectorAll("img")).map(r=>{
101100
const url = galleryThumbnailUrlToActualUrl(r.getAttribute("src"));
102-
const urlType = ICON_URL_TAILS[Object.keys(ICON_URL_TAILS).find(pattern=>url.endsWith(pattern))??"default"]
101+
const urlType = Object.entries(ICON_URL_TAILS).find(p=>url.endsWith(p[0]))?.[1] ?? "unknown"
103102
return {url, urlType}
104103
});
105104
}
@@ -223,4 +222,4 @@ export async function fetchGallery(
223222
skins: skins,
224223
gallery: gallery,
225224
};
226-
}
225+
}

0 commit comments

Comments
 (0)