From 30c03e267267770ffba33e050d41b38e8b6f2213 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 23 Oct 2025 11:32:59 -0700 Subject: refactor: drs,around,diva display cleanup logic --- .../src/components/displays/DivaScoreDisplay.tsx | 34 +++------------------- 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'frontend/src/components/displays/DivaScoreDisplay.tsx') diff --git a/frontend/src/components/displays/DivaScoreDisplay.tsx b/frontend/src/components/displays/DivaScoreDisplay.tsx index 74dd431..2646b6b 100644 --- a/frontend/src/components/displays/DivaScoreDisplay.tsx +++ b/frontend/src/components/displays/DivaScoreDisplay.tsx @@ -44,8 +44,6 @@ const DivaScoreDisplay: React.FC = ({ }) => { // Key mappings for better display names. Hit or miss const keyDisplayNames: Record = { - title: "Title", - artist: "Artist", score: "SCORE", difficulty: "Difficulty Rating", lamp: "CLEAR RANK", @@ -53,13 +51,7 @@ const DivaScoreDisplay: React.FC = ({ timestamp: "Date", judgements: "Judgements", maxCombo: "Max Combo", - perfect: "Perfect", - great: "Great", - good: "Good", - bad: "Bad", - miss: "Miss", username: "Username", - num_players: "Players" }; const mainStatKeys = [ @@ -69,6 +61,7 @@ const DivaScoreDisplay: React.FC = ({ "diff_lamp", ]; const expandableKeys = ["judgements", "optional"]; + const gameParam = new URLSearchParams(window.location.search).get("game") || "diva"; // eslint-disable-next-line @typescript-eslint/no-explicit-any const formatValue = (value: any, key: string): string => { if (value === null || value === undefined) return "N/A"; @@ -318,10 +311,9 @@ const DivaScoreDisplay: React.FC = ({ return (
{sortedScores.map((score, index) => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { mainStats, expandable, others, timestamp } = + const chartIdHash = SHA1(`${gameParam}${score.title}${score.artist}`).toString(); + const { mainStats, expandable, timestamp } = getScoreEntries(score); - const chartIdHash = SHA1(`diva${score.title}${score.artist}`).toString(); return (
= ({
{!hideTitleArtist && ( - +

{score.title || score.song || "Unknown Title"}

@@ -376,24 +368,6 @@ const DivaScoreDisplay: React.FC = ({
))} - {/* Other fields */} - {others.length > 0 && ( -
-
- {others.map(([key, value]) => ( -
- - {getDisplayName(key)}: - - - {renderValue(value, key)} - -
- ))} -
-
- )} - {/* Timestamp */}

-- cgit v1.2.3