summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/Library.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-10-28 02:19:19 +0200
committerPetr Mrázek <peterix@gmail.com>2016-10-28 02:19:19 +0200
commitdd0e996081ae820a0f16b5a6854a8a6274c5edf5 (patch)
tree9d9f0ba7ff51b546d15106f71841f9de42a09f2b /api/logic/minecraft/Library.cpp
parent3d94fb8d24c6012d5d1cdee61c99e62847c06ad9 (diff)
downloadMultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar.gz
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar.lz
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar.xz
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.zip
GH-1697 always stale files tolerate errors if a local copy is present
This fixes the situation when liteloader snapshot site is broken and there's an older local snapshot already present.
Diffstat (limited to 'api/logic/minecraft/Library.cpp')
-rw-r--r--api/logic/minecraft/Library.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/api/logic/minecraft/Library.cpp b/api/logic/minecraft/Library.cpp
index 8bbd5503..5a75fe79 100644
--- a/api/logic/minecraft/Library.cpp
+++ b/api/logic/minecraft/Library.cpp
@@ -131,6 +131,11 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
}
return true;
}
+ Net::Download::Options options;
+ if(isAlwaysStale)
+ {
+ options |= Net::Download::Option::AcceptLocalFiles;
+ }
if (isForge)
{
out.append(ForgeXzDownload::make(storage, entry));
@@ -140,13 +145,13 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
if(sha1.size())
{
auto rawSha1 = QByteArray::fromHex(sha1.toLatin1());
- auto dl = Net::Download::makeCached(url, entry);
+ auto dl = Net::Download::makeCached(url, entry, options);
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
out.append(dl);
}
else
- out.append(Net::Download::makeCached(url, entry));
+ out.append(Net::Download::makeCached(url, entry, options));
}
return true;
};