diff --git a/websites/G/Granblue Fantasy/metadata.json b/websites/G/Granblue Fantasy/metadata.json index ffcc39afe28b..2ec348455d0a 100644 --- a/websites/G/Granblue Fantasy/metadata.json +++ b/websites/G/Granblue Fantasy/metadata.json @@ -22,7 +22,7 @@ "vi_VN": "Trò chơi đóng vai Nhật Bản" }, "url": "game.granbluefantasy.jp", - "version": "1.5.1", + "version": "1.5.2", "logo": "https://cdn.rcd.gg/PreMiD/websites/G/Granblue%20Fantasy/assets/logo.png", "thumbnail": "https://cdn.rcd.gg/PreMiD/websites/G/Granblue%20Fantasy/assets/thumbnail.jpg", "color": "#2F4F7A", diff --git a/websites/G/Granblue Fantasy/presence.ts b/websites/G/Granblue Fantasy/presence.ts index fc8855cd8bf3..58c7be926826 100644 --- a/websites/G/Granblue Fantasy/presence.ts +++ b/websites/G/Granblue Fantasy/presence.ts @@ -153,7 +153,11 @@ presence.on("UpdateData", async () => { } else if (href.includes("/#result")) presenceData.details = "In a Quest result screen"; else if (href.includes("/#raid") || href.includes("/#raid_multi")) { - const boss = gameStatus?.boss?.param.find(x => x.alive); + const bosses = gameStatus?.boss?.param.sort( + (a, b) => parseInt(b.hpmax) - parseInt(a.hpmax) + ), + boss = bosses?.find(x => x.alive) || bosses?.[0]; + if (boss) { if (boss.name.ja !== boss.name.en) presenceData.details = `${boss.name.en} (${boss.name.ja})`; @@ -180,8 +184,10 @@ presence.on("UpdateData", async () => { ).toFixed(2)}%]`; } - if (turn && gameStatus?.turn) - presenceData.state += ` | Turn ${gameStatus.turn}`; + if (turn && gameStatus?.turn) { + if (!presenceData.state) presenceData.state = `Turn ${gameStatus.turn}`; + else presenceData.state += ` | Turn ${gameStatus.turn}`; + } if (djeeta && gameStatus?.player) { const charaAlive = gameStatus.player.param.find(x => x.leader);