diff --git a/EftPatchHelper/EftPatchHelper/EftPatchHelper.csproj b/EftPatchHelper/EftPatchHelper/EftPatchHelper.csproj index b498643..b7ceda2 100644 --- a/EftPatchHelper/EftPatchHelper/EftPatchHelper.csproj +++ b/EftPatchHelper/EftPatchHelper/EftPatchHelper.csproj @@ -5,8 +5,8 @@ net8.0 enable enable - 1.5.7 - 1.5.7 + 1.5.8 + 1.5.8 diff --git a/EftPatchHelper/EftPatchHelper/Interfaces/ICompressPatcherTask.cs b/EftPatchHelper/EftPatchHelper/Interfaces/ICompressPatcherTask.cs deleted file mode 100644 index 37df474..0000000 --- a/EftPatchHelper/EftPatchHelper/Interfaces/ICompressPatcherTask.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace EftPatchHelper.Interfaces; - -public interface ICompressPatcherTask : ITaskable -{ -} \ No newline at end of file diff --git a/EftPatchHelper/EftPatchHelper/Interfaces/ICompressPatcherTasks.cs b/EftPatchHelper/EftPatchHelper/Interfaces/ICompressPatcherTasks.cs new file mode 100644 index 0000000..e06b9dd --- /dev/null +++ b/EftPatchHelper/EftPatchHelper/Interfaces/ICompressPatcherTasks.cs @@ -0,0 +1,5 @@ +namespace EftPatchHelper.Interfaces; + +public interface ICompressPatcherTasks : ITaskable +{ +} \ No newline at end of file diff --git a/EftPatchHelper/EftPatchHelper/Model/GoFileUpload.cs b/EftPatchHelper/EftPatchHelper/Model/GoFileUpload.cs index 3ec7941..887480c 100644 --- a/EftPatchHelper/EftPatchHelper/Model/GoFileUpload.cs +++ b/EftPatchHelper/EftPatchHelper/Model/GoFileUpload.cs @@ -30,7 +30,7 @@ namespace EftPatchHelper.Model _folderId = folderId; UploadFileInfo = file; ServiceName = "GoFile"; - DisplayName = $"{ServiceName} Upload: {UploadFileInfo.Name}"; + DisplayName = $"{ServiceName} Upload"; HubEntryText = $"Download from {ServiceName}"; AddHubEntry = true; } diff --git a/EftPatchHelper/EftPatchHelper/Model/MegaUpload.cs b/EftPatchHelper/EftPatchHelper/Model/MegaUpload.cs index 87583d2..2109377 100644 --- a/EftPatchHelper/EftPatchHelper/Model/MegaUpload.cs +++ b/EftPatchHelper/EftPatchHelper/Model/MegaUpload.cs @@ -27,7 +27,7 @@ namespace EftPatchHelper.Model _email = email; _password = password; ServiceName = "Mega"; - DisplayName = $"{ServiceName} Upload: {UploadFileInfo.Name}"; + DisplayName = $"{ServiceName} Upload"; HubEntryText = $"Download from {ServiceName}"; AddHubEntry = true; } diff --git a/EftPatchHelper/EftPatchHelper/Model/SftpUpload.cs b/EftPatchHelper/EftPatchHelper/Model/SftpUpload.cs index 696716f..5e063da 100644 --- a/EftPatchHelper/EftPatchHelper/Model/SftpUpload.cs +++ b/EftPatchHelper/EftPatchHelper/Model/SftpUpload.cs @@ -30,7 +30,7 @@ public class SftpUpload : IFileUpload }; ServiceName = _sftpInfo.Hostname; - DisplayName = $"{ServiceName} Upload: {UploadFileInfo.Name}"; + DisplayName = $"{ServiceName} Upload"; HubEntryText = $"Download from {ServiceName}"; AddHubEntry = false; } diff --git a/EftPatchHelper/EftPatchHelper/Program.cs b/EftPatchHelper/EftPatchHelper/Program.cs index d172edf..0df99de 100644 --- a/EftPatchHelper/EftPatchHelper/Program.cs +++ b/EftPatchHelper/EftPatchHelper/Program.cs @@ -20,6 +20,7 @@ namespace EftPatchHelper ITaskable _fileProcessingTasks; ITaskable _patchGenTasks; ITaskable _patchTestingTasks; + private ITaskable _compressPatcherTasks; ITaskable _createReleaseTasks; ITaskable _uploadTasks; @@ -45,6 +46,7 @@ namespace EftPatchHelper IFileProcessingTasks fileProcessingTasks, IPatchGenTasks patchGenTasks, IPatchTestingTasks patchTestingTasks, + ICompressPatcherTasks compressPatcherTasks, IUploadTasks uploadTasks, IReleaseCreator createReleaseTasks ) @@ -55,6 +57,7 @@ namespace EftPatchHelper _fileProcessingTasks = fileProcessingTasks; _patchGenTasks = patchGenTasks; _patchTestingTasks = patchTestingTasks; + _compressPatcherTasks = compressPatcherTasks; _createReleaseTasks = createReleaseTasks; _uploadTasks = uploadTasks; } @@ -67,6 +70,7 @@ namespace EftPatchHelper _fileProcessingTasks.Run(); _patchGenTasks.Run(); _patchTestingTasks.Run(); + _compressPatcherTasks.Run(); _uploadTasks.Run(); _createReleaseTasks.Run(); } @@ -84,6 +88,9 @@ namespace EftPatchHelper return settings; }); + services.AddSingleton(); + services.AddSingleton(); + services.AddScoped(); services.AddTransient(); @@ -92,7 +99,7 @@ namespace EftPatchHelper services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/EftPatchHelper/EftPatchHelper/Tasks/CompressPatcherTask.cs b/EftPatchHelper/EftPatchHelper/Tasks/CompressPatcherTasks.cs similarity index 88% rename from EftPatchHelper/EftPatchHelper/Tasks/CompressPatcherTask.cs rename to EftPatchHelper/EftPatchHelper/Tasks/CompressPatcherTasks.cs index e3974a2..b4b1ab3 100644 --- a/EftPatchHelper/EftPatchHelper/Tasks/CompressPatcherTask.cs +++ b/EftPatchHelper/EftPatchHelper/Tasks/CompressPatcherTasks.cs @@ -6,13 +6,13 @@ using Spectre.Console; namespace EftPatchHelper.Tasks; -public class CompressPatcherTask : ICompressPatcherTask +public class CompressPatcherTasks : ICompressPatcherTasks { private Options _options; private FileHelper _fileHelper; private ZipHelper _zipHelper; - public CompressPatcherTask(Options options, FileHelper fileHelper, ZipHelper zipHelper) + public CompressPatcherTasks(Options options, FileHelper fileHelper, ZipHelper zipHelper) { _options = options; _fileHelper = fileHelper; @@ -21,7 +21,7 @@ public class CompressPatcherTask : ICompressPatcherTask public bool CompressPatcher() { - AnsiConsole.Progress() + return AnsiConsole.Progress() .Columns(new ProgressColumn[] { new TaskDescriptionColumn(), @@ -32,6 +32,7 @@ public class CompressPatcherTask : ICompressPatcherTask }) .Start(ctx => { + var compressionTask = ctx.AddTask("Compressing Patcher"); compressionTask.MaxValue = 100; @@ -41,20 +42,18 @@ public class CompressPatcherTask : ICompressPatcherTask } var patchFolder = new DirectoryInfo(_options.OutputPatchPath); + + var patchArchiveFile = new FileInfo(_options.OutputPatchPath + ".7z"); if (!patchFolder.Exists) { return false; } - var patchArchiveFile = new FileInfo(_options.OutputPatchPath + ".7z"); - var progress = new Progress(p => { compressionTask.Increment(p - compressionTask.Percentage);}); return _zipHelper.Compress(patchFolder, patchArchiveFile, progress); }); - - return false; } public void Run() diff --git a/EftPatchHelper/EftPatchHelper/Tasks/PatchGenTasks.cs b/EftPatchHelper/EftPatchHelper/Tasks/PatchGenTasks.cs index 8ae1da3..87ab931 100644 --- a/EftPatchHelper/EftPatchHelper/Tasks/PatchGenTasks.cs +++ b/EftPatchHelper/EftPatchHelper/Tasks/PatchGenTasks.cs @@ -48,6 +48,7 @@ namespace EftPatchHelper.Tasks $"OutputFolderName::{patcherOutputName}", $"SourceFolderPath::{_options.SourceClient.PrepPath}", $"TargetFolderPath::{_options.TargetClient.PrepPath}", + $"AutoZip::false", $"AutoClose::{_settings.AutoClose}" } }); diff --git a/EftPatchHelper/EftPatchHelper/Tasks/UploadTasks.cs b/EftPatchHelper/EftPatchHelper/Tasks/UploadTasks.cs index 04ca816..fae6559 100644 --- a/EftPatchHelper/EftPatchHelper/Tasks/UploadTasks.cs +++ b/EftPatchHelper/EftPatchHelper/Tasks/UploadTasks.cs @@ -45,7 +45,7 @@ namespace EftPatchHelper.Tasks { var gofile = new GoFileUpload(patcherFile, _settings.GoFileApiKey, _settings.GoFileFolderId); _fileUploads.Add(gofile); - AnsiConsole.WriteLine("Added MEGA"); + AnsiConsole.WriteLine("Added GoFile"); } if (_settings.SftpUploads.Count > 0 && _options.UploadToSftpSites) @@ -134,6 +134,8 @@ namespace EftPatchHelper.Tasks { return false; } + + AnsiConsole.MarkupLine($"[blue]Starting {_fileUploads[0].UploadFileInfo.Name} uploads ...[/]"); var succeeded = await AnsiConsole.Progress().Columns( new TaskDescriptionColumn() { Alignment = Justify.Left},