From 3da7b60ded4f69e6f380de185008625e01ff2c00 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Nov 2025 12:45:29 +0000 Subject: [PATCH] fix: correct property names and Series.maybeMap usage Fix compilation errors in library browser views: - Use serverUrl instead of url on AudiobookShelfServer model - Use authToken instead of token on AuthenticatedUser model - Add all required variant handlers to Series.maybeMap call These changes align with the actual model definitions in the codebase. --- lib/features/library_browser/view/library_authors_page.dart | 4 ++-- lib/features/library_browser/view/library_series_page.dart | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/features/library_browser/view/library_authors_page.dart b/lib/features/library_browser/view/library_authors_page.dart index 59db1a4..c01cc8d 100644 --- a/lib/features/library_browser/view/library_authors_page.dart +++ b/lib/features/library_browser/view/library_authors_page.dart @@ -87,7 +87,7 @@ class AuthorCard extends HookConsumerWidget { // Build the image URL if imagePath is available String? imageUrl; if (imagePath != null && apiSettings.activeServer != null) { - imageUrl = '${apiSettings.activeServer!.url}/api/authors/${author.id}/image'; + imageUrl = '${apiSettings.activeServer!.serverUrl}/api/authors/${author.id}/image'; } return Card( @@ -111,7 +111,7 @@ class AuthorCard extends HookConsumerWidget { ? CachedNetworkImage( imageUrl: imageUrl, httpHeaders: { - 'Authorization': 'Bearer ${apiSettings.activeUser?.token}', + 'Authorization': 'Bearer ${apiSettings.activeUser?.authToken}', }, fit: BoxFit.cover, placeholder: (context, url) => Container( diff --git a/lib/features/library_browser/view/library_series_page.dart b/lib/features/library_browser/view/library_series_page.dart index c2516c2..50fbab1 100644 --- a/lib/features/library_browser/view/library_series_page.dart +++ b/lib/features/library_browser/view/library_series_page.dart @@ -62,8 +62,12 @@ class SeriesListTile extends StatelessWidget { // Extract series data based on variant final String seriesName = series.name; final int? numBooks = series.maybeMap( + (s) => null, // base variant numBooks: (s) => s.numBooks, books: (s) => s.books.length, + sequence: (s) => null, + shelf: (s) => s.books.length, + author: (s) => s.items?.length, orElse: () => null, );