mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-07-08 15:14:37 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 949abc2582 | |||
| 3b3423dd9b | |||
| 8380e88744 | |||
| f1bc5a2266 |
@@ -197,7 +197,7 @@ jobs:
|
|||||||
path: ${{ matrix.app }}/
|
path: ${{ matrix.app }}/
|
||||||
|
|
||||||
- name: Set permissions
|
- name: Set permissions
|
||||||
if: ${{ !startsWith(matrix.rid, 'win') }}
|
if: ${{ !startsWith(matrix.rid, 'win-') }}
|
||||||
run: chmod +x ${{ matrix.app }}/${{ matrix.asset }}
|
run: chmod +x ${{ matrix.app }}/${{ matrix.asset }}
|
||||||
|
|
||||||
- name: Create package
|
- name: Create package
|
||||||
|
|||||||
@@ -4,9 +4,8 @@
|
|||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<ApplicationIcon>..\favicon.ico</ApplicationIcon>
|
<ApplicationIcon>..\favicon.ico</ApplicationIcon>
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
<NoWarn>$(NoWarn);IL2104</NoWarn>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CliFx" Version="2.3.5" />
|
<PackageReference Include="CliFx" Version="2.3.5" />
|
||||||
<PackageReference Include="CSharpier.MsBuild" Version="0.28.2" PrivateAssets="all" />
|
<PackageReference Include="CSharpier.MsBuild" Version="0.28.2" PrivateAssets="all" />
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ using System.Threading.Tasks;
|
|||||||
using CliFx;
|
using CliFx;
|
||||||
using DiscordChatExporter.Cli.Commands;
|
using DiscordChatExporter.Cli.Commands;
|
||||||
using DiscordChatExporter.Cli.Commands.Converters;
|
using DiscordChatExporter.Cli.Commands.Converters;
|
||||||
|
using DiscordChatExporter.Core.Exporting.Filtering;
|
||||||
|
using DiscordChatExporter.Core.Exporting.Partitioning;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Cli;
|
namespace DiscordChatExporter.Cli;
|
||||||
|
|
||||||
@@ -22,6 +24,8 @@ public static class Program
|
|||||||
typeof(ThreadInclusionModeBindingConverter)
|
typeof(ThreadInclusionModeBindingConverter)
|
||||||
)]
|
)]
|
||||||
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(TruthyBooleanBindingConverter))]
|
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(TruthyBooleanBindingConverter))]
|
||||||
|
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(PartitionLimit))]
|
||||||
|
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(MessageFilter))]
|
||||||
public static async Task<int> Main(string[] args) =>
|
public static async Task<int> Main(string[] args) =>
|
||||||
await new CliApplicationBuilder()
|
await new CliApplicationBuilder()
|
||||||
.AddCommand<ExportAllCommand>()
|
.AddCommand<ExportAllCommand>()
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<PackageReference Include="Material.Avalonia" Version="3.6.0" />
|
<PackageReference Include="Material.Avalonia" Version="3.6.0" />
|
||||||
<PackageReference Include="Material.Icons.Avalonia" Version="2.1.9" />
|
<PackageReference Include="Material.Icons.Avalonia" Version="2.1.9" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
<PackageReference Include="Onova" Version="2.6.11" />
|
<PackageReference Include="Onova" Version="2.6.12" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -9,18 +9,20 @@ namespace DiscordChatExporter.Gui.Services;
|
|||||||
|
|
||||||
public class UpdateService(SettingsService settingsService) : IDisposable
|
public class UpdateService(SettingsService settingsService) : IDisposable
|
||||||
{
|
{
|
||||||
private readonly IUpdateManager _updateManager = new UpdateManager(
|
private readonly IUpdateManager? _updateManager = OperatingSystem.IsWindows()
|
||||||
new GithubPackageResolver(
|
? new UpdateManager(
|
||||||
"Tyrrrz",
|
new GithubPackageResolver(
|
||||||
"DiscordChatExporter",
|
"Tyrrrz",
|
||||||
// Examples:
|
"DiscordChatExporter",
|
||||||
// DiscordChatExporter.win-arm64.zip
|
// Examples:
|
||||||
// DiscordChatExporter.win-x64.zip
|
// DiscordChatExporter.win-arm64.zip
|
||||||
// DiscordChatExporter.linux-x64.zip
|
// DiscordChatExporter.win-x64.zip
|
||||||
$"DiscordChatExporter.{RuntimeInformation.RuntimeIdentifier}.zip"
|
// DiscordChatExporter.linux-x64.zip
|
||||||
),
|
$"DiscordChatExporter.{RuntimeInformation.RuntimeIdentifier}.zip"
|
||||||
new ZipPackageExtractor()
|
),
|
||||||
);
|
new ZipPackageExtractor()
|
||||||
|
)
|
||||||
|
: null;
|
||||||
|
|
||||||
private Version? _updateVersion;
|
private Version? _updateVersion;
|
||||||
private bool _updatePrepared;
|
private bool _updatePrepared;
|
||||||
@@ -28,6 +30,9 @@ public class UpdateService(SettingsService settingsService) : IDisposable
|
|||||||
|
|
||||||
public async ValueTask<Version?> CheckForUpdatesAsync()
|
public async ValueTask<Version?> CheckForUpdatesAsync()
|
||||||
{
|
{
|
||||||
|
if (_updateManager is null)
|
||||||
|
return null;
|
||||||
|
|
||||||
if (!settingsService.IsAutoUpdateEnabled)
|
if (!settingsService.IsAutoUpdateEnabled)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -37,6 +42,9 @@ public class UpdateService(SettingsService settingsService) : IDisposable
|
|||||||
|
|
||||||
public async ValueTask PrepareUpdateAsync(Version version)
|
public async ValueTask PrepareUpdateAsync(Version version)
|
||||||
{
|
{
|
||||||
|
if (_updateManager is null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!settingsService.IsAutoUpdateEnabled)
|
if (!settingsService.IsAutoUpdateEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -57,11 +65,10 @@ public class UpdateService(SettingsService settingsService) : IDisposable
|
|||||||
|
|
||||||
public void FinalizeUpdate(bool needRestart)
|
public void FinalizeUpdate(bool needRestart)
|
||||||
{
|
{
|
||||||
if (!settingsService.IsAutoUpdateEnabled)
|
if (_updateManager is null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Onova only works on Windows currently
|
if (!settingsService.IsAutoUpdateEnabled)
|
||||||
if (!OperatingSystem.IsWindows())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_updateVersion is null || !_updatePrepared || _updaterLaunched)
|
if (_updateVersion is null || !_updatePrepared || _updaterLaunched)
|
||||||
@@ -82,5 +89,5 @@ public class UpdateService(SettingsService settingsService) : IDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() => _updateManager.Dispose();
|
public void Dispose() => _updateManager?.Dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user