mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-23 19:39:30 +00:00
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.
This commit is contained in:
parent
fafd4c5315
commit
3da7b60ded
2 changed files with 6 additions and 2 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue