Add locations to todo items and automate Gitea deploy
Some checks failed
Redeploy Docker Compose / redeploy (push) Failing after 2s
Some checks failed
Redeploy Docker Compose / redeploy (push) Failing after 2s
This commit is contained in:
@@ -422,6 +422,17 @@ function getRarity(raw) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function getKnownLocations(raw) {
|
||||
const value = raw.known_locations;
|
||||
if (!Array.isArray(value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return value
|
||||
.map((location) => normalizeName(location))
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
function getItemIconUrl(iconPath, slug) {
|
||||
const itemImageBase = 'https://items.marathondb.gg/images/items';
|
||||
const apiBase = 'https://helpbot.marathondb.gg';
|
||||
@@ -554,6 +565,7 @@ function buildUpgradeResults(factionUpgrades, itemsBySlug) {
|
||||
name: entry.item.name,
|
||||
iconUrl: entry.item.iconUrl,
|
||||
rarity: entry.item.rarity,
|
||||
knownLocations: entry.item.knownLocations,
|
||||
}));
|
||||
|
||||
mappedLevels.push({
|
||||
@@ -602,12 +614,14 @@ function buildCatalog(itemsPayload, factionUpgradesPayload, updatedAtMs) {
|
||||
const slug = getSlug(row);
|
||||
const iconPath = getIconPath(row);
|
||||
const rarity = getRarity(row);
|
||||
const knownLocations = getKnownLocations(row);
|
||||
return {
|
||||
id: slug,
|
||||
slug,
|
||||
name,
|
||||
iconUrl: getItemIconUrl(iconPath, slug),
|
||||
rarity,
|
||||
knownLocations,
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
Reference in New Issue
Block a user