diff options
author | Ryan Cao <70191398+ryanccn@users.noreply.github.com> | 2022-05-28 21:15:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-28 21:15:00 +0800 |
commit | 2be8100e7cb625f3e6356a68f20291c5aa327c02 (patch) | |
tree | eaf364705154e0457a1bde40dff8b2c8d843c8e5 /launcher/modplatform/flame/FileResolvingTask.cpp | |
parent | 6d0ea13f97570f837f11022e3ef0fbfb6d0482f5 (diff) | |
parent | 3ff26d5cfe293c635655d35e96d093ef0b383dc2 (diff) | |
download | PrismLauncher-2be8100e7cb625f3e6356a68f20291c5aa327c02.tar.gz PrismLauncher-2be8100e7cb625f3e6356a68f20291c5aa327c02.tar.bz2 PrismLauncher-2be8100e7cb625f3e6356a68f20291c5aa327c02.zip |
Merge branch 'develop' into global-jvm-args
Diffstat (limited to 'launcher/modplatform/flame/FileResolvingTask.cpp')
-rw-r--r-- | launcher/modplatform/flame/FileResolvingTask.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp index 0deb99c4..95924a68 100644 --- a/launcher/modplatform/flame/FileResolvingTask.cpp +++ b/launcher/modplatform/flame/FileResolvingTask.cpp @@ -31,21 +31,7 @@ void Flame::FileResolvingTask::netJobFinished() for (auto& bytes : results) { auto& out = m_toProcess.files[index]; try { - bool fail = (!out.parseFromBytes(bytes)); - if(fail){ - //failed :( probably disabled mod, try to add to the list - auto doc = Json::requireDocument(bytes); - if (!doc.isObject()) { - throw JSONValidationError(QString("data is not an object? that's not supposed to happen")); - } - auto obj = Json::ensureObject(doc.object(), "data"); - //FIXME : HACK, MAY NOT WORK FOR LONG - out.url = QUrl(QString("https://media.forgecdn.net/files/%1/%2/%3") - .arg(QString::number(QString::number(out.fileId).leftRef(4).toInt()) - ,QString::number(QString::number(out.fileId).rightRef(3).toInt()) - ,QUrl::toPercentEncoding(out.fileName)), QUrl::TolerantMode); - } - failed &= fail; + failed &= (!out.parseFromBytes(bytes)); } catch (const JSONValidationError& e) { qCritical() << "Resolving of" << out.projectId << out.fileId << "failed because of a parsing error:"; qCritical() << e.cause(); |