Finished IIDX metadata
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
Trenton Zimmer 2025-12-14 14:01:44 -05:00
parent 427d61c442
commit 9bc6cc04e5
9 changed files with 57 additions and 14 deletions

View File

@ -1,4 +1,4 @@
VITE_APP_VERSION="3.0.37"
VITE_APP_VERSION="3.0.38"
VITE_API_URL="http://localhost:8000/"
VITE_API_KEY="your_api_key_should_be_here"
VITE_ASSET_PATH="/assets"

View File

@ -1,4 +1,4 @@
VITE_APP_VERSION="3.0.37"
VITE_APP_VERSION="3.0.38"
VITE_API_URL="https://restfulsleep.phaseii.network"
VITE_API_KEY="your_api_key_should_be_here"
VITE_ASSET_PATH="https://cdn.phaseii.network/file/PhaseII/web-assets"

View File

@ -36,5 +36,6 @@
"3.0.34": ["- (Major) Add support for Jubeat titles", "- (Major) Add base BTA support"],
"3.0.35": ["- (Bugfix) Fix cursor hover state on news card and profile card", "- (Minor) Update DDR game options", "- (Minor) Update IIDX event settings", "- (Minor) Add IIDX 32 basic QPro settings"],
"3.0.36": ["- (Major) Finish more game metadata (DRS, Museca, Nostalgia, pop'n, jubeat)"],
"3.0.37": ["- (Major) Finish more game metadata (RB, SDVX, FTT)", "- (Bugfix) Fix personal record button showing for games without scores."]
"3.0.37": ["- (Major) Finish more game metadata (RB, SDVX, FTT)", "- (Bugfix) Fix personal record button showing for games without scores."],
"3.0.38": ["- (Major) Finish IIDX base metadata", "- (Minor) Add new greeting"]
}

View File

@ -600,5 +600,10 @@
"author": "RyogAkari",
"header": "Greetings, <username>.",
"comment": "You tawt you taw a PASELI Cat."
},
{
"author": "Metis",
"header": "Hey... come here often, <username>?",
"comment": ""
}
]

View File

@ -1257,7 +1257,8 @@ export const gameData = [
VersionConstants.IIDX_PINKY_CRUSH,
],
scoreHeaders: [
{ text: "Grade", value: "data.rank", width: 80 },
{ text: "Grade", value: "data.rank", width: 60 },
{ text: "Percent", value: "data.achievement_rate", width: 100 },
{ text: "Misses", value: "data.miss_count", width: 100 },
{ text: "Clear Status", value: "data.medal", width: 100 },
],

View File

@ -1,5 +1,6 @@
import { formatSortableDate } from "@/constants/date";
import { formatDifficulty, rankFromScore } from "@/constants/scoreDataFilters";
import { formatIIDXScore } from "@/helpers/score/iidx";
export function scoreHeaders(thisGame) {
const headers = [
@ -57,13 +58,14 @@ export function topScoreHeaders(thisGame) {
return headers;
}
export function formatScoreData(thisGame, data) {
return data;
}
export function formatScoreTable(thisGame, scores) {
var formattedItems = [];
for (var item of scores) {
if (item.song?.data?.notecount) {
const maxScore = item.song.data.notecount * 2;
item = formatIIDXScore(maxScore, item);
}
if (item.newRecord) {
item.newRecord = "✅";
} else {

11
src/helpers/score/iidx.js Normal file
View File

@ -0,0 +1,11 @@
export function formatIIDXScore(maxScore, data) {
var scoreData = JSON.parse(JSON.stringify(data));
if (maxScore) {
var rate = (scoreData?.points / maxScore) * 100;
rate = Math.round(rate * 100) / 100;
scoreData.data.achievement_rate = rate * 100;
}
return scoreData;
}

View File

@ -0,0 +1,26 @@
import { GameConstants } from "@/constants";
import { formatIIDXScore } from "@/helpers/score/iidx";
export function hydrateScoreData(thisGame, data) {
/*
Generate and fill in depth score data
*/
var songData = JSON.parse(JSON.stringify(data));
if (thisGame?.id == GameConstants.IIDX) {
for (const chartId in songData.charts) {
var chart = songData.charts[chartId];
const maxScore = (chart.data.notecount ?? 5730) * 2;
chart.records = chart?.records.map((v) => ({ ...v, maxScore: maxScore }));
for (const recordIndex in chart.records) {
var record = chart.records[recordIndex];
record = formatIIDXScore(record.maxScore, record);
chart.records[recordIndex] = record;
}
songData.charts[chartId] = chart;
}
}
console.log(songData);
return songData;
}

View File

@ -15,11 +15,8 @@ import GameHeader from "@/components/Cards/GameHeader.vue";
import { APIGetTopScore } from "@/stores/api/music";
import { getGameInfo } from "@/constants";
import { formatDifficulty } from "@/constants/scoreDataFilters";
import {
topScoreHeaders,
formatScoreData,
formatScoreTable,
} from "@/constants/table/scores";
import { hydrateScoreData } from "@/helpers/score";
import { topScoreHeaders, formatScoreTable } from "@/constants/table/scores";
const $route = useRoute();
const $router = useRouter();
var gameId = $route.params.game;
@ -39,7 +36,7 @@ if (!thisGame) {
onMounted(async () => {
try {
const data = await APIGetTopScore(gameId, songId);
songData.value = formatScoreData(thisGame, data);
songData.value = hydrateScoreData(thisGame, data);
} catch (error) {
console.error("Failed to fetch score data:", error);
}