From 212f073c33d48624fd4d09dbe4e12644e522f746 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 28 Mar 2022 10:33:00 -0400 Subject: [PATCH] Remove botched json-fixing Dalamud asset update code The JSON seems to be fixed now, later on I will be implementing a better "asset update" failed mechanism to handle edge cases like these. --- src/assetupdater.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/assetupdater.cpp b/src/assetupdater.cpp index f1c1728..383c8e8 100644 --- a/src/assetupdater.cpp +++ b/src/assetupdater.cpp @@ -66,19 +66,8 @@ void AssetUpdater::update(const ProfileSettings& profile) { connect(reply, &QNetworkReply::finished, [reply, this, profile] { dialog->setLabelText("Checking for Dalamud asset updates..."); - // lol, they actually provide invalid json. let's fix it if it's borked - QString badJson = reply->readAll(); - - auto lastCommaLoc = badJson.lastIndexOf(','); - auto lastBracketLoc = badJson.lastIndexOf('{'); - - // basically, if { supersedes the last , - if (lastCommaLoc > lastBracketLoc) { - qInfo() << "Dalamud server gave bad json, attempting to fix..."; - badJson.remove(lastCommaLoc, 1); - } - - QJsonDocument doc = QJsonDocument::fromJson(badJson.toUtf8()); + // TODO: handle asset failure + QJsonDocument doc = QJsonDocument::fromJson(reply->readAll()); qInfo() << "Dalamud asset remote version" << doc.object()["Version"].toInt(); qInfo() << "Dalamud asset local version" << launcher.dalamudAssetVersion;