mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-06-09 15:52:37 -06:00
Merge branch 'prime' into feat/recurring-cli-scrape
This commit is contained in:
commit
8401bb06c0
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Install Docker Buildx
|
- 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
|
- name: Build image
|
||||||
run: >
|
run: >
|
||||||
|
|
@ -58,7 +58,7 @@ jobs:
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Install Docker Buildx
|
- 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
|
- name: Login to DockerHub
|
||||||
run: >
|
run: >
|
||||||
|
|
|
||||||
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
|
|
@ -29,7 +29,7 @@ jobs:
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Install .NET
|
- 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
|
# Build the project separately to discern between build and format errors
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
@ -84,7 +84,7 @@ jobs:
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Install .NET
|
- name: Install .NET
|
||||||
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
|
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
|
|
@ -100,7 +100,7 @@ jobs:
|
||||||
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
|
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
|
||||||
|
|
||||||
- name: Upload coverage
|
- name: Upload coverage
|
||||||
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ jobs:
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Install .NET
|
- name: Install .NET
|
||||||
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
|
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
|
||||||
|
|
||||||
- name: Publish app
|
- name: Publish app
|
||||||
run: >
|
run: >
|
||||||
|
|
@ -255,7 +255,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Notify Discord
|
- name: Notify Discord
|
||||||
uses: tyrrrz/action-http-request@25f132e48dea89c0f6b7955398270b506e1d51cb # 1.1.4
|
uses: tyrrrz/action-http-request@110f1a0f0f7e91c3b2de349539249f4573c243fa # 1.1.5
|
||||||
with:
|
with:
|
||||||
url: ${{ secrets.DISCORD_WEBHOOK }}
|
url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
method: POST
|
method: POST
|
||||||
|
|
|
||||||
|
|
@ -7,33 +7,33 @@
|
||||||
<PackageVersion Include="AngleSharp" Version="1.4.0" />
|
<PackageVersion Include="AngleSharp" Version="1.4.0" />
|
||||||
<PackageVersion Include="AsyncImageLoader.Avalonia" Version="3.8.0" />
|
<PackageVersion Include="AsyncImageLoader.Avalonia" Version="3.8.0" />
|
||||||
<PackageVersion Include="AsyncKeyedLock" Version="8.0.2" />
|
<PackageVersion Include="AsyncKeyedLock" Version="8.0.2" />
|
||||||
<PackageVersion Include="Avalonia" Version="12.0.2" />
|
<PackageVersion Include="Avalonia" Version="12.0.4" />
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="12.0.2" />
|
<PackageVersion Include="Avalonia.Desktop" Version="12.0.4" />
|
||||||
<PackageVersion Include="CliFx" Version="3.0.0" />
|
<PackageVersion Include="CliFx" Version="3.0.0" />
|
||||||
<PackageVersion Include="Cogwheel" Version="2.1.1" />
|
<PackageVersion Include="Cogwheel" Version="2.1.1" />
|
||||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" />
|
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" />
|
||||||
<PackageVersion Include="coverlet.collector" Version="10.0.0" />
|
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
|
||||||
<PackageVersion Include="CSharpier.MsBuild" Version="1.2.6" />
|
<PackageVersion Include="CSharpier.MsBuild" Version="1.2.6" />
|
||||||
<PackageVersion Include="Deorcify" Version="1.1.0" />
|
<PackageVersion Include="Deorcify" Version="1.1.0" />
|
||||||
<PackageVersion Include="DialogHost.Avalonia" Version="0.12.1" />
|
<PackageVersion Include="DialogHost.Avalonia" Version="0.12.2" />
|
||||||
<PackageVersion Include="FluentAssertions" Version="8.9.0" />
|
<PackageVersion Include="FluentAssertions" Version="8.10.0" />
|
||||||
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.3" />
|
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.4" />
|
||||||
<PackageVersion Include="Gress" Version="2.2.0" />
|
<PackageVersion Include="Gress" Version="2.2.0" />
|
||||||
<PackageVersion Include="JsonExtensions" Version="1.2.0" />
|
<PackageVersion Include="JsonExtensions" Version="1.2.0" />
|
||||||
<PackageVersion Include="Markdig" Version="1.1.3" />
|
<PackageVersion Include="Markdig" Version="1.2.0" />
|
||||||
<PackageVersion Include="Material.Avalonia" Version="3.16.1" />
|
<PackageVersion Include="Material.Avalonia" Version="3.16.1" />
|
||||||
<PackageVersion Include="Material.Icons.Avalonia" Version="3.0.2" />
|
<PackageVersion Include="Material.Icons.Avalonia" Version="3.0.2" />
|
||||||
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.7" />
|
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.8" />
|
||||||
<PackageVersion
|
<PackageVersion
|
||||||
Include="Microsoft.Extensions.Configuration.EnvironmentVariables"
|
Include="Microsoft.Extensions.Configuration.EnvironmentVariables"
|
||||||
Version="10.0.7"
|
Version="10.0.8"
|
||||||
/>
|
/>
|
||||||
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.7" />
|
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.8" />
|
||||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.7" />
|
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
|
||||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
|
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
|
||||||
<PackageVersion Include="Onova" Version="2.6.13" />
|
<PackageVersion Include="Onova" Version="2.6.13" />
|
||||||
<PackageVersion Include="Polly" Version="8.6.6" />
|
<PackageVersion Include="Polly" Version="8.6.6" />
|
||||||
<PackageVersion Include="PowerKit" Version="1.1.1" />
|
<PackageVersion Include="PowerKit" Version="1.2.0" />
|
||||||
<PackageVersion Include="RazorBlade" Version="1.0.0" />
|
<PackageVersion Include="RazorBlade" Version="1.0.0" />
|
||||||
<PackageVersion Include="Spectre.Console" Version="0.55.2" />
|
<PackageVersion Include="Spectre.Console" Version="0.55.2" />
|
||||||
<PackageVersion Include="Superpower" Version="3.1.0" />
|
<PackageVersion Include="Superpower" Version="3.1.0" />
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
@ -64,7 +65,14 @@ internal partial class ExportAssetDownloader(string workingDirPath, bool reuse)
|
||||||
async innerCancellationToken =>
|
async innerCancellationToken =>
|
||||||
{
|
{
|
||||||
// Download the file
|
// 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 using var output = File.Create(filePath);
|
||||||
await response.Content.CopyToAsync(output, innerCancellationToken);
|
await response.Content.CopyToAsync(output, innerCancellationToken);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using Avalonia.Platform;
|
||||||
using DiscordChatExporter.Gui.Framework;
|
using DiscordChatExporter.Gui.Framework;
|
||||||
using DiscordChatExporter.Gui.Localization;
|
using DiscordChatExporter.Gui.Localization;
|
||||||
using DiscordChatExporter.Gui.Services;
|
using DiscordChatExporter.Gui.Services;
|
||||||
|
using DiscordChatExporter.Gui.Utils.Extensions;
|
||||||
using DiscordChatExporter.Gui.ViewModels;
|
using DiscordChatExporter.Gui.ViewModels;
|
||||||
using DiscordChatExporter.Gui.ViewModels.Components;
|
using DiscordChatExporter.Gui.ViewModels.Components;
|
||||||
using DiscordChatExporter.Gui.ViewModels.Dialogs;
|
using DiscordChatExporter.Gui.ViewModels.Dialogs;
|
||||||
|
|
@ -17,7 +18,7 @@ using PowerKit.Extensions;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Gui;
|
namespace DiscordChatExporter.Gui;
|
||||||
|
|
||||||
public class App : Application, IDisposable
|
public partial class App : Application, IDisposable
|
||||||
{
|
{
|
||||||
private readonly ServiceProvider _services;
|
private readonly ServiceProvider _services;
|
||||||
private readonly SettingsService _settingsService;
|
private readonly SettingsService _settingsService;
|
||||||
|
|
@ -135,3 +136,12 @@ public class App : Application, IDisposable
|
||||||
_services.Dispose();
|
_services.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public partial class App
|
||||||
|
{
|
||||||
|
public static void Shutdown(int exitCode = 0)
|
||||||
|
{
|
||||||
|
if (Current?.ApplicationLifetime?.TryShutdown(exitCode) != true)
|
||||||
|
Environment.Exit(exitCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using DiscordChatExporter.Core.Discord.Data;
|
using DiscordChatExporter.Core.Discord.Data;
|
||||||
|
using DiscordChatExporter.Gui.Localization;
|
||||||
using DiscordChatExporter.Gui.ViewModels;
|
using DiscordChatExporter.Gui.ViewModels;
|
||||||
using DiscordChatExporter.Gui.ViewModels.Components;
|
using DiscordChatExporter.Gui.ViewModels.Components;
|
||||||
using DiscordChatExporter.Gui.ViewModels.Dialogs;
|
using DiscordChatExporter.Gui.ViewModels.Dialogs;
|
||||||
|
|
@ -8,7 +9,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Gui.Framework;
|
namespace DiscordChatExporter.Gui.Framework;
|
||||||
|
|
||||||
public class ViewModelManager(IServiceProvider services)
|
public class ViewModelManager(IServiceProvider services, LocalizationManager localizationManager)
|
||||||
{
|
{
|
||||||
public MainViewModel GetMainViewModel() => services.GetRequiredService<MainViewModel>();
|
public MainViewModel GetMainViewModel() => services.GetRequiredService<MainViewModel>();
|
||||||
|
|
||||||
|
|
@ -46,7 +47,7 @@ public class ViewModelManager(IServiceProvider services)
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageBoxViewModel GetMessageBoxViewModel(string title, string message) =>
|
public MessageBoxViewModel GetMessageBoxViewModel(string title, string message) =>
|
||||||
GetMessageBoxViewModel(title, message, "CLOSE", null);
|
GetMessageBoxViewModel(title, message, localizationManager.CloseButton, null);
|
||||||
|
|
||||||
public SettingsViewModel GetSettingsViewModel() =>
|
public SettingsViewModel GetSettingsViewModel() =>
|
||||||
services.GetRequiredService<SettingsViewModel>();
|
services.GetRequiredService<SettingsViewModel>();
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,20 @@ namespace DiscordChatExporter.Gui.ViewModels.Dialogs;
|
||||||
public partial class MessageBoxViewModel : DialogViewModelBase
|
public partial class MessageBoxViewModel : DialogViewModelBase
|
||||||
{
|
{
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
public partial string? Title { get; set; } = "Title";
|
public partial string? Title { get; set; }
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
public partial string? Message { get; set; } = "Message";
|
public partial string? Message { get; set; }
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
[NotifyPropertyChangedFor(nameof(IsDefaultButtonVisible))]
|
[NotifyPropertyChangedFor(nameof(IsDefaultButtonVisible))]
|
||||||
[NotifyPropertyChangedFor(nameof(ButtonsCount))]
|
[NotifyPropertyChangedFor(nameof(ButtonsCount))]
|
||||||
public partial string? DefaultButtonText { get; set; } = "OK";
|
public partial string? DefaultButtonText { get; set; }
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
[NotifyPropertyChangedFor(nameof(IsCancelButtonVisible))]
|
[NotifyPropertyChangedFor(nameof(IsCancelButtonVisible))]
|
||||||
[NotifyPropertyChangedFor(nameof(ButtonsCount))]
|
[NotifyPropertyChangedFor(nameof(ButtonsCount))]
|
||||||
public partial string? CancelButtonText { get; set; } = "Cancel";
|
public partial string? CancelButtonText { get; set; }
|
||||||
|
|
||||||
public bool IsDefaultButtonVisible => !string.IsNullOrWhiteSpace(DefaultButtonText);
|
public bool IsDefaultButtonVisible => !string.IsNullOrWhiteSpace(DefaultButtonText);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia;
|
|
||||||
using DiscordChatExporter.Gui.Framework;
|
using DiscordChatExporter.Gui.Framework;
|
||||||
using DiscordChatExporter.Gui.Localization;
|
using DiscordChatExporter.Gui.Localization;
|
||||||
using DiscordChatExporter.Gui.Services;
|
using DiscordChatExporter.Gui.Services;
|
||||||
using DiscordChatExporter.Gui.Utils.Extensions;
|
|
||||||
using DiscordChatExporter.Gui.ViewModels.Components;
|
using DiscordChatExporter.Gui.ViewModels.Components;
|
||||||
using PowerKit.Extensions;
|
using PowerKit.Extensions;
|
||||||
|
|
||||||
|
|
@ -88,8 +85,7 @@ public partial class MainViewModel(
|
||||||
{
|
{
|
||||||
updateService.FinalizeUpdate(true);
|
updateService.FinalizeUpdate(true);
|
||||||
|
|
||||||
if (Application.Current?.ApplicationLifetime?.TryShutdown(2) != true)
|
App.Shutdown(2);
|
||||||
Environment.Exit(2);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue