qwen edit

This commit is contained in:
Курнат Андрей
2026-02-18 14:49:20 +03:00
parent 1d9224a025
commit f0a3c19a3c
4 changed files with 126 additions and 21 deletions

View File

@@ -26,6 +26,12 @@ public partial class CalibreLibraryViewModel : BaseViewModel
[ObservableProperty]
private string _downloadStatus = string.Empty;
[ObservableProperty]
private bool _isRefreshing;
[ObservableProperty]
private string _connectionErrorMessage = string.Empty;
private int _currentPage;
public CalibreLibraryViewModel(
@@ -67,6 +73,7 @@ public partial class CalibreLibraryViewModel : BaseViewModel
if (IsBusy || !IsConfigured) return;
IsBusy = true;
_currentPage = 0;
ConnectionErrorMessage = string.Empty;
try
{
@@ -79,7 +86,8 @@ public partial class CalibreLibraryViewModel : BaseViewModel
}
catch (Exception ex)
{
await _navigationService.DisplayAlertAsync("Error", $"Failed to load library: {ex.Message}", "OK");
ConnectionErrorMessage = "No connection to Calibre server";
System.Diagnostics.Debug.WriteLine($"Error loading Calibre library: {ex.Message}");
}
finally
{
@@ -87,6 +95,22 @@ public partial class CalibreLibraryViewModel : BaseViewModel
}
}
[RelayCommand]
public async Task RefreshBooksAsync()
{
if (IsRefreshing || !IsConfigured) return;
IsRefreshing = true;
try
{
await LoadBooksAsync();
}
finally
{
IsRefreshing = false;
}
}
[RelayCommand]
public async Task LoadMoreBooksAsync()
{