diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-15 10:36:05 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-15 10:36:05 +0300 |
commit | 1ff8136f98cf3bb2983043fcaaf3e65366b4e6d4 (patch) | |
tree | c62f2832c80c185af47498273596eeeecd79cd15 /launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | |
parent | d33de2e4277dfcd090a36c96e09148ea6a5d2e55 (diff) | |
parent | 9908e115aa6bdfcceefd1425406d1b6d1c1bdec4 (diff) | |
download | PrismLauncher-1ff8136f98cf3bb2983043fcaaf3e65366b4e6d4.tar.gz PrismLauncher-1ff8136f98cf3bb2983043fcaaf3e65366b4e6d4.tar.bz2 PrismLauncher-1ff8136f98cf3bb2983043fcaaf3e65366b4e6d4.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into scale_cat
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthPackExportTask.cpp')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp index 29df90dd..bff9bf42 100644 --- a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp @@ -27,7 +27,7 @@ #include "minecraft/PackProfile.h" #include "minecraft/mod/ModFolderModel.h" -const QStringList ModrinthPackExportTask::PREFIXES({ "mods", "coremods", "resourcepacks", "texturepacks", "shaderpacks" }); +const QStringList ModrinthPackExportTask::PREFIXES({ "mods/", "coremods/", "resourcepacks/", "texturepacks/", "shaderpacks/" }); const QStringList ModrinthPackExportTask::FILE_EXTENSIONS({ "jar", "litemod", "zip" }); ModrinthPackExportTask::ModrinthPackExportTask(const QString& name, @@ -99,14 +99,12 @@ void ModrinthPackExportTask::collectHashes() const QString relative = gameRoot.relativeFilePath(file.absoluteFilePath()); // require sensible file types - if (!std::any_of(PREFIXES.begin(), PREFIXES.end(), - [&relative](const QString& prefix) { return relative.startsWith(prefix + QDir::separator()); })) + if (!std::any_of(PREFIXES.begin(), PREFIXES.end(), [&relative](const QString& prefix) { return relative.startsWith(prefix); })) continue; if (!std::any_of(FILE_EXTENSIONS.begin(), FILE_EXTENSIONS.end(), [&relative](const QString& extension) { return relative.endsWith('.' + extension) || relative.endsWith('.' + extension + ".disabled"); - })) { + })) continue; - } QCryptographicHash sha512(QCryptographicHash::Algorithm::Sha512); @@ -303,9 +301,7 @@ QByteArray ModrinthPackExportTask::generateIndex() const ResolvedFile& value = iterator.value(); QJsonObject file; - QString path = iterator.key(); - path.replace(QDir::separator(), "/"); - file["path"] = path; + file["path"] = iterator.key(); file["downloads"] = QJsonArray({ iterator.value().url }); QJsonObject hashes; |