feat: implement background ebook indexing with progress tracking and real-time UI updates
This commit is contained in:
@@ -16,6 +16,7 @@ public class SyncService : ISyncService, IAsyncDisposable
|
||||
private CancellationTokenSource? _debounceCts;
|
||||
|
||||
public event Func<string, DateTime, Task>? OnProgressReceived;
|
||||
public event Func<string, double, Task>? OnIngestionProgressReceived;
|
||||
|
||||
public SyncService(
|
||||
HttpClient httpClient,
|
||||
@@ -53,6 +54,11 @@ public class SyncService : ISyncService, IAsyncDisposable
|
||||
if (OnProgressReceived != null) await OnProgressReceived(pageId, timestamp);
|
||||
});
|
||||
|
||||
_hubConnection.On<string, double>("IngestionProgress", async (message, progress) =>
|
||||
{
|
||||
if (OnIngestionProgressReceived != null) await OnIngestionProgressReceived(message, progress);
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
await _hubConnection.StartAsync();
|
||||
|
||||
Reference in New Issue
Block a user