Add locations to todo items and automate Gitea deploy
Some checks failed
Redeploy Docker Compose / redeploy (push) Failing after 2s

This commit is contained in:
2026-03-26 18:44:33 +01:00
parent 0ec3222873
commit 124de9f5b8
8 changed files with 220 additions and 14 deletions

View File

@@ -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);