Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add size check for download rotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 10, 2023
1 parent 328d286 commit 9976c69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Resources/whitelist.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
"RotationSolver.Default - ArchiTed",
"DefaultRotations - ArchiTed",
"RotationSolver.Default"
]
7 changes: 7 additions & 0 deletions RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public static async void GetAllCustomRotations()
//Download
using (HttpResponseMessage response = await client.GetAsync(url))
{
if (File.Exists(filePath))
{
if(new FileInfo(filePath).Length == response.Content.Headers.ContentLength)
{
continue;
}
}
await response.Content.CopyToAsync(new FileStream(filePath, File.Exists(filePath)
? FileMode.Open : FileMode.CreateNew));
}
Expand Down

0 comments on commit 9976c69

Please sign in to comment.