aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/ModIndex.cpp
diff options
context:
space:
mode:
authorflow <thiagodonato300@gmail.com>2022-05-07 19:39:00 -0300
committerflow <flowlnlnln@gmail.com>2022-05-23 14:58:08 -0300
commit0985adfd74758891c2e61c2de7f930119cab1386 (patch)
treeace9b0cb3744a0ffbbeebfa3aab2ef5d15eb7f9b /launcher/modplatform/ModIndex.cpp
parent59d628208b403bfb2442291cbca139cbdfcd325f (diff)
downloadPrismLauncher-0985adfd74758891c2e61c2de7f930119cab1386.tar.gz
PrismLauncher-0985adfd74758891c2e61c2de7f930119cab1386.tar.bz2
PrismLauncher-0985adfd74758891c2e61c2de7f930119cab1386.zip
change: support newest changes with packwiz regarding CF
Diffstat (limited to 'launcher/modplatform/ModIndex.cpp')
-rw-r--r--launcher/modplatform/ModIndex.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/launcher/modplatform/ModIndex.cpp b/launcher/modplatform/ModIndex.cpp
index f6e134e0..6027c4f3 100644
--- a/launcher/modplatform/ModIndex.cpp
+++ b/launcher/modplatform/ModIndex.cpp
@@ -30,7 +30,8 @@ auto ProviderCapabilities::hashType(Provider p) -> QStringList
case Provider::MODRINTH:
return { "sha512", "sha1" };
case Provider::FLAME:
- return { "murmur2" };
+ // Try newer formats first, fall back to old format
+ return { "sha1", "md5", "murmur2" };
}
return {};
}
@@ -51,7 +52,14 @@ auto ProviderCapabilities::hash(Provider p, QByteArray& data, QString type) -> Q
return QCryptographicHash::hash(data, QCryptographicHash::Sha512);
}
case Provider::FLAME:
- // TODO
+ // If 'type' was specified, we use that
+ if (!type.isEmpty() && hashType(p).contains(type)) {
+ if(type == "sha1")
+ return QCryptographicHash::hash(data, QCryptographicHash::Sha1);
+ else if (type == "md5")
+ return QCryptographicHash::hash(data, QCryptographicHash::Md5);
+ }
+
break;
}
return {};