mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-18 16:46:58 -04:00
Feat[download]: don't always redowload files with missing hashes
This commit is contained in:
@@ -137,7 +137,11 @@ public class DownloadUtils {
|
||||
|
||||
public static <T> T ensureSha1(File outputFile, @Nullable String sha1, Callable<T> downloadFunction) throws IOException {
|
||||
// Skip if needed
|
||||
if(sha1 == null) return downloadFile(downloadFunction);
|
||||
if(sha1 == null) {
|
||||
// If the file exists and we don't know it's SHA1, don't try to redownload it.
|
||||
if(outputFile.exists()) return null;
|
||||
else return downloadFile(downloadFunction);
|
||||
}
|
||||
|
||||
int attempts = 0;
|
||||
boolean fileOkay = verifyFile(outputFile, sha1);
|
||||
|
||||
Reference in New Issue
Block a user