1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2025-07-05 12:38:51 +02:00

Compare commits

..

No commits in common. "08dec7deb30dbcd46449e1060e914bfa46fa3e0c" and "895d69279f9c0f6cda4af2043f4defc5d1a489a9" have entirely different histories.

8 changed files with 3 additions and 30 deletions

View File

@ -45,8 +45,5 @@
</StackPanel> </StackPanel>
</WrapPanel> </WrapPanel>
</Expander> </Expander>
<Expander Header="About" IsExpanded="True">
<TextBlock Text="{Binding SqliteVersion, StringFormat=Sqlite Version: {0}}" />
</Expander>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@ -9,18 +9,14 @@ using DHT.Desktop.Dialogs.Progress;
using DHT.Server; using DHT.Server;
using DHT.Server.Data; using DHT.Server.Data;
using DHT.Server.Service; using DHT.Server.Service;
using PropertyChanged.SourceGenerator;
namespace DHT.Desktop.Main.Pages; namespace DHT.Desktop.Main.Pages;
sealed partial class DebugPageModel { sealed class DebugPageModel {
public string GenerateChannels { get; set; } = "0"; public string GenerateChannels { get; set; } = "0";
public string GenerateUsers { get; set; } = "0"; public string GenerateUsers { get; set; } = "0";
public string GenerateMessages { get; set; } = "0"; public string GenerateMessages { get; set; } = "0";
[Notify(Setter.Private)]
private string? sqliteVersion = string.Empty;
private readonly Window window; private readonly Window window;
private readonly State state; private readonly State state;
@ -32,10 +28,6 @@ sealed partial class DebugPageModel {
this.state = state; this.state = state;
} }
public async Task Initialize() {
SqliteVersion = await state.Db.GetVersion() ?? "<unknown>";
}
public async void OnClickAddRandomDataToDatabase() { public async void OnClickAddRandomDataToDatabase() {
if (!int.TryParse(GenerateChannels, out int channels) || channels < 1) { if (!int.TryParse(GenerateChannels, out int channels) || channels < 1) {
await Dialog.ShowOk(window, "Generate Random Data", "Amount of channels must be at least 1!"); await Dialog.ShowOk(window, "Generate Random Data", "Amount of channels must be at least 1!");
@ -177,8 +169,6 @@ sealed class DebugPageModel {
public string GenerateUsers { get; set; } = "0"; public string GenerateUsers { get; set; } = "0";
public string GenerateMessages { get; set; } = "0"; public string GenerateMessages { get; set; } = "0";
public string SqliteVersion => string.Empty;
public void OnClickAddRandomDataToDatabase() {} public void OnClickAddRandomDataToDatabase() {}
} }
#endif #endif

View File

@ -70,10 +70,6 @@ sealed class MainContentScreenModel : IAsyncDisposable {
public async Task Initialize() { public async Task Initialize() {
await DownloadsPageModel.Initialize(); await DownloadsPageModel.Initialize();
#if DEBUG
await DebugPageModel.Initialize();
#endif
} }
public async ValueTask DisposeAsync() { public async ValueTask DisposeAsync() {

View File

@ -19,10 +19,6 @@ sealed class DummyDatabaseFile : IDatabaseFile {
private DummyDatabaseFile() {} private DummyDatabaseFile() {}
public Task<string?> GetVersion() {
return Task.FromResult<string?>(null);
}
public Task Vacuum() { public Task Vacuum() {
return Task.CompletedTask; return Task.CompletedTask;
} }

View File

@ -14,6 +14,5 @@ public interface IDatabaseFile : IAsyncDisposable {
IMessageRepository Messages { get; } IMessageRepository Messages { get; }
IDownloadRepository Downloads { get; } IDownloadRepository Downloads { get; }
Task<string?> GetVersion();
Task Vacuum(); Task Vacuum();
} }

View File

@ -80,11 +80,6 @@ public sealed class SqliteDatabaseFile : IDatabaseFile {
await pool.DisposeAsync(); await pool.DisposeAsync();
} }
public async Task<string?> GetVersion() {
await using var conn = await pool.Take();
return await conn.ExecuteReaderAsync("SELECT sqlite_version()", static reader => reader?.GetString(0));
}
public async Task Vacuum() { public async Task Vacuum() {
await using var conn = await pool.Take(); await using var conn = await pool.Take();

View File

@ -11,7 +11,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.6" /> <PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.7" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" /> <PackageReference Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup> </ItemGroup>

View File

@ -8,5 +8,5 @@ using DHT.Utils;
namespace DHT.Utils; namespace DHT.Utils;
static class Version { static class Version {
public const string Tag = "47.1.0.0"; public const string Tag = "47.0.0.0";
} }