Skip to content

Commit

Permalink
Merge #2892 Notify when falling back to archive.org URL
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed Oct 19, 2019
2 parents 37f5388 + b5e40d9 commit fbcb3a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
- [Multiple] Normalize install paths (#2887 by: HebaruSan; reviewed: DasSkelett)
- [Multiple] Fixes for KSP in Windows drive root (#2857 by: HebaruSan; reviewed: DasSkelett)
- [GUI] Use current metadata for installed module compatibility (#2886 by: HebaruSan; reviewed: DasSkelett)
- [Core] Notify when falling back to archive.org URL (#2892 by: HebaruSan; reviewed: DasSkelett)

### Internal

Expand Down
7 changes: 6 additions & 1 deletion Core/Net/NetAsyncDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ private void FileDownloadComplete(int index, Exception error)
if (!downloads[index].triedFallback && downloads[index].fallbackUrl != null)
{
log.InfoFormat("Trying fallback URL: {0}", downloads[index].fallbackUrl);
// Encode spaces to avoid confusing URL parsers
User.RaiseMessage("Failed to download \"{0}\", trying fallback \"{1}\"",
downloads[index].url.ToString().Replace(" ", "%20"),
downloads[index].fallbackUrl.ToString().Replace(" ", "%20")
);
// Try the fallbackUrl
downloads[index].triedFallback = true;
downloads[index].Download(downloads[index].fallbackUrl, downloads[index].path);
Expand All @@ -503,4 +508,4 @@ private void FileDownloadComplete(int index, Exception error)
}
}
}
}
}

0 comments on commit fbcb3a9

Please sign in to comment.