mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-22 20:47:45 +00:00
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.
This commit is contained in:
parent
3b8f66be66
commit
212f073c33
1 changed files with 2 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue