qwen edit
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user