Skip to content

Commit

Permalink
Download archives again, when they change on server
Browse files Browse the repository at this point in the history
  • Loading branch information
HighPriest committed Jan 21, 2025
1 parent 95a2c6d commit 35b83d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions DownloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ public void restoreRBRBackup(string directory)
public void saveFile(string destinationDir, Supabase.Storage.FileObject file, System.ComponentModel.BackgroundWorker backgroundWorker)
{
// Check if file has already been downloaded & skip the download phase if it exists
if (File.Exists(Path.Combine(destinationDir, file.Name)))
if (File.Exists(Path.Combine(destinationDir, file.Name)) && File.GetLastWriteTime(Path.Combine(destinationDir, file.Name)) > file.UpdatedAt)
{
// TODO: Do a check of file.CreatedAt & only if they don't match local file, do download
return;
}

Expand Down Expand Up @@ -388,19 +387,22 @@ public void installRBRConfiguration(string targetDir, System.ComponentModel.Back
System.IO.File.Move(file.Value, targetDir, true);
if (((file.Index * 100 / files_count) % 10) == 0)
{
backgroundWorker.ReportProgress((file.Index * 100 / files_count) % 100, "Installing: " + file.Value);
backgroundWorker.ReportProgress((file.Index * 100 / files_count) % 100, "Installing: " + targetDir);
}
}
}

public void installRBRPackage(string targetDir, string packageName, System.ComponentModel.BackgroundWorker backgroundWorker)
{
// This can't be executed in WorkerComplete! The background worker is attached here, but can't be used.
// backgroundWorker.ReportProgress(0, "Configuring: " + packageName);
string packagePath = Path.Combine(targetDir, "backup\\FilipekMod\\", packageName);
Directory.CreateDirectory(Path.GetDirectoryName(targetDir));
if (packagePath.EndsWith(".zip"))
{
ExtractZipFile(System.IO.File.ReadAllBytes(packagePath), targetDir);
}

}
#endregion RBRConfigurationMethods
}
Expand Down
2 changes: 1 addition & 1 deletion Pacenotes_Installer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
Expand Down

0 comments on commit 35b83d0

Please sign in to comment.