From 54300c933ebea4dd1723d8481f1e3c68ba41cd75 Mon Sep 17 00:00:00 2001 From: Galexion Date: Tue, 25 Jul 2023 00:50:15 -0400 Subject: [PATCH] Fixed Ban Button & Fixed UI Jacket issue (Requires SegaParser Re-Run) --- dbhandler.js | 29 +++++++++++++++++++++++++---- public/javascript/user.js | 4 ++-- readme.md | 3 ++- views/index.ejs | 16 ++++++++-------- 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/dbhandler.js b/dbhandler.js index 2aab11f..b780f50 100644 --- a/dbhandler.js +++ b/dbhandler.js @@ -269,8 +269,7 @@ async function getUserBanned(req) { return new Promise((resolve, reject) => { var request = req.body; if (request.input === undefined) { - return reject('Failed to update user ban state, insufficent paramaters') - return + return reject('Failed to update user ban state, insufficent paramaters'); } db.run('UPDATE maimai2_user_detail SET ban_state = ? WHERE id = ?', [2, request.input], function (err) { if (err) { @@ -282,7 +281,18 @@ async function getUserBanned(req) { }); }); } else { - + var con = await establishConnection(); + return new Promise((resolve, reject) => { + var request = req.body; + con.query(`UPDATE aime.mai2_profile_detail SET banState = 2 WHERE user = ${request.input}`, function (err, result, fields) { + if (err) { + reject({ "status": "failure", "message": "Unable to ban user, see reason", "reason": err }) + throw err + }; + con.release(); + resolve({ "status": "Success", "message": `User ${request.input} banned.` }) + }) + }); } } @@ -305,7 +315,18 @@ async function getUserUnbanned(req) { }); }); } else { - + var con = await establishConnection(); + return new Promise((resolve, reject) => { + var request = req.body; + con.query(`UPDATE aime.mai2_profile_detail SET banState = 0 WHERE user = ${request.input}`, function (err, result, fields) { + if (err) { + reject({ "status": "failure", "message": "Unable to ban user, see reason", "reason": err }) + throw err + }; + con.release(); + resolve({ "status": "Success", "message": `User ${request.input} banned.` }) + }) + }); } } diff --git a/public/javascript/user.js b/public/javascript/user.js index 75fd9e2..8146c4d 100644 --- a/public/javascript/user.js +++ b/public/javascript/user.js @@ -223,7 +223,7 @@ async function userPlayLogFormatter(div, loadMoreButton) { errorIncrement++ continue; } - + console.log(song) scoreDiv.innerHTML = `

${song.name.str} || ${new Date(score.user_play_date||score.userPlayDate)}

@@ -237,7 +237,7 @@ async function userPlayLogFormatter(div, loadMoreButton) { }); scoreJacketDiv.classList.add('score-jacket'); jacket.classList.add('score-jacket'); - jacket.src = "assets/jacket/UI_Jacket_" + padNumber(Number(score.music_id||score.musicId), 6) + '.png'; + jacket.src = "assets/jacket/UI_Jacket_" + padNumber(Number(song.InGameID), 6) + '.png'; scoreJacketDiv.append(jacket) scoreDiv.append(scoreJacketDiv) diff --git a/readme.md b/readme.md index c158607..a8f6f59 100644 --- a/readme.md +++ b/readme.md @@ -119,7 +119,8 @@ ToDo: - Re-Create the MaiMaiDXNet Playlog list (90% Done, can't continue without image assets that are only on the offical Server) - Create Detailed Look Into Score - Create Photos Tab - - Create a rudementrary Photos tab until i can finallly get my hands on images of the Photos tab in MaiMai DX Net + - Create a rudementrary Photos tab until i can finallly get my hands on images of the Photos tab in MaiMai DX Net (Done) + - Create a actual Photos Tab - Create Area Tab - Get User Area Data (Done) - Get Metadata for Area (Done) diff --git a/views/index.ejs b/views/index.ejs index dd6e1f9..acc1869 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -21,15 +21,15 @@
-

- Known Issues: -

-
+
+ +

Issue Log:

+
+
- Site Is Not Complete
- - Unfortunatly Some Song Jackets Cannot be found, which will lead certain lisenced and original songs to - load without their jackets when checking your play log.
- - Artemis does not Support Memorial Photos, though that is coming. -
+ - Artemis does not Support Memorial Photos, though that is coming.
+ UI Jackets Have Now been fixed, please redl segapaser and rerun music.js.
+