diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 33177c50..ec56bde2 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Docker Buildx
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
+ uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Build image
run: >
@@ -58,7 +58,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Docker Buildx
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
+ uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Login to DockerHub
run: >
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ca12cc5e..d458d0f2 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install .NET
- uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
+ uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
# Build the project separately to discern between build and format errors
- name: Build
@@ -84,7 +84,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install .NET
- uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
+ uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
- name: Run tests
env:
@@ -100,7 +100,7 @@ jobs:
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: Upload coverage
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
+ uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
@@ -139,7 +139,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install .NET
- uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
+ uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
- name: Publish app
run: >
@@ -255,7 +255,7 @@ jobs:
steps:
- name: Notify Discord
- uses: tyrrrz/action-http-request@25f132e48dea89c0f6b7955398270b506e1d51cb # 1.1.4
+ uses: tyrrrz/action-http-request@110f1a0f0f7e91c3b2de349539249f4573c243fa # 1.1.5
with:
url: ${{ secrets.DISCORD_WEBHOOK }}
method: POST
diff --git a/Directory.Packages.props b/Directory.Packages.props
index a2df34fd..0f031eee 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -7,33 +7,33 @@
-
-
+
+
-
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
-
+
diff --git a/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs b/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs
index eb44d4a9..071616ec 100644
--- a/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs
+++ b/DiscordChatExporter.Core/Exporting/ExportAssetDownloader.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
@@ -64,7 +65,14 @@ internal partial class ExportAssetDownloader(string workingDirPath, bool reuse)
async innerCancellationToken =>
{
// Download the file
- using var response = await Http.Client.GetAsync(url, innerCancellationToken);
+ using var response = await Http.Client.GetAsync(
+ url,
+ HttpCompletionOption.ResponseHeadersRead,
+ innerCancellationToken
+ );
+
+ response.EnsureSuccessStatusCode();
+
await using var output = File.Create(filePath);
await response.Content.CopyToAsync(output, innerCancellationToken);
},
diff --git a/DiscordChatExporter.Gui/App.axaml.cs b/DiscordChatExporter.Gui/App.axaml.cs
index 92640636..37179c5c 100644
--- a/DiscordChatExporter.Gui/App.axaml.cs
+++ b/DiscordChatExporter.Gui/App.axaml.cs
@@ -7,6 +7,7 @@ using Avalonia.Platform;
using DiscordChatExporter.Gui.Framework;
using DiscordChatExporter.Gui.Localization;
using DiscordChatExporter.Gui.Services;
+using DiscordChatExporter.Gui.Utils.Extensions;
using DiscordChatExporter.Gui.ViewModels;
using DiscordChatExporter.Gui.ViewModels.Components;
using DiscordChatExporter.Gui.ViewModels.Dialogs;
@@ -17,7 +18,7 @@ using PowerKit.Extensions;
namespace DiscordChatExporter.Gui;
-public class App : Application, IDisposable
+public partial class App : Application, IDisposable
{
private readonly ServiceProvider _services;
private readonly SettingsService _settingsService;
@@ -135,3 +136,12 @@ public class App : Application, IDisposable
_services.Dispose();
}
}
+
+public partial class App
+{
+ public static void Shutdown(int exitCode = 0)
+ {
+ if (Current?.ApplicationLifetime?.TryShutdown(exitCode) != true)
+ Environment.Exit(exitCode);
+ }
+}
diff --git a/DiscordChatExporter.Gui/Framework/ViewModelManager.cs b/DiscordChatExporter.Gui/Framework/ViewModelManager.cs
index aaed957d..0e25c2e7 100644
--- a/DiscordChatExporter.Gui/Framework/ViewModelManager.cs
+++ b/DiscordChatExporter.Gui/Framework/ViewModelManager.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using DiscordChatExporter.Core.Discord.Data;
+using DiscordChatExporter.Gui.Localization;
using DiscordChatExporter.Gui.ViewModels;
using DiscordChatExporter.Gui.ViewModels.Components;
using DiscordChatExporter.Gui.ViewModels.Dialogs;
@@ -8,7 +9,7 @@ using Microsoft.Extensions.DependencyInjection;
namespace DiscordChatExporter.Gui.Framework;
-public class ViewModelManager(IServiceProvider services)
+public class ViewModelManager(IServiceProvider services, LocalizationManager localizationManager)
{
public MainViewModel GetMainViewModel() => services.GetRequiredService();
@@ -46,7 +47,7 @@ public class ViewModelManager(IServiceProvider services)
}
public MessageBoxViewModel GetMessageBoxViewModel(string title, string message) =>
- GetMessageBoxViewModel(title, message, "CLOSE", null);
+ GetMessageBoxViewModel(title, message, localizationManager.CloseButton, null);
public SettingsViewModel GetSettingsViewModel() =>
services.GetRequiredService();
diff --git a/DiscordChatExporter.Gui/ViewModels/Dialogs/MessageBoxViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Dialogs/MessageBoxViewModel.cs
index fd695003..75c78f2e 100644
--- a/DiscordChatExporter.Gui/ViewModels/Dialogs/MessageBoxViewModel.cs
+++ b/DiscordChatExporter.Gui/ViewModels/Dialogs/MessageBoxViewModel.cs
@@ -6,20 +6,20 @@ namespace DiscordChatExporter.Gui.ViewModels.Dialogs;
public partial class MessageBoxViewModel : DialogViewModelBase
{
[ObservableProperty]
- public partial string? Title { get; set; } = "Title";
+ public partial string? Title { get; set; }
[ObservableProperty]
- public partial string? Message { get; set; } = "Message";
+ public partial string? Message { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsDefaultButtonVisible))]
[NotifyPropertyChangedFor(nameof(ButtonsCount))]
- public partial string? DefaultButtonText { get; set; } = "OK";
+ public partial string? DefaultButtonText { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsCancelButtonVisible))]
[NotifyPropertyChangedFor(nameof(ButtonsCount))]
- public partial string? CancelButtonText { get; set; } = "Cancel";
+ public partial string? CancelButtonText { get; set; }
public bool IsDefaultButtonVisible => !string.IsNullOrWhiteSpace(DefaultButtonText);
diff --git a/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs b/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs
index 0c0cd32f..169d50ce 100644
--- a/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs
+++ b/DiscordChatExporter.Gui/ViewModels/MainViewModel.cs
@@ -1,11 +1,8 @@
-using System;
using System.Diagnostics;
using System.Threading.Tasks;
-using Avalonia;
using DiscordChatExporter.Gui.Framework;
using DiscordChatExporter.Gui.Localization;
using DiscordChatExporter.Gui.Services;
-using DiscordChatExporter.Gui.Utils.Extensions;
using DiscordChatExporter.Gui.ViewModels.Components;
using PowerKit.Extensions;
@@ -88,8 +85,7 @@ public partial class MainViewModel(
{
updateService.FinalizeUpdate(true);
- if (Application.Current?.ApplicationLifetime?.TryShutdown(2) != true)
- Environment.Exit(2);
+ App.Shutdown(2);
}
);
}