mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-01-07 02:39:32 +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
|
// Build the image URL if imagePath is available
|
||||||
String? imageUrl;
|
String? imageUrl;
|
||||||
if (imagePath != null && apiSettings.activeServer != null) {
|
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(
|
return Card(
|
||||||
|
|
@ -111,7 +111,7 @@ class AuthorCard extends HookConsumerWidget {
|
||||||
? CachedNetworkImage(
|
? CachedNetworkImage(
|
||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
httpHeaders: {
|
httpHeaders: {
|
||||||
'Authorization': 'Bearer ${apiSettings.activeUser?.token}',
|
'Authorization': 'Bearer ${apiSettings.activeUser?.authToken}',
|
||||||
},
|
},
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
placeholder: (context, url) => Container(
|
placeholder: (context, url) => Container(
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,12 @@ class SeriesListTile extends StatelessWidget {
|
||||||
// Extract series data based on variant
|
// Extract series data based on variant
|
||||||
final String seriesName = series.name;
|
final String seriesName = series.name;
|
||||||
final int? numBooks = series.maybeMap(
|
final int? numBooks = series.maybeMap(
|
||||||
|
(s) => null, // base variant
|
||||||
numBooks: (s) => s.numBooks,
|
numBooks: (s) => s.numBooks,
|
||||||
books: (s) => s.books.length,
|
books: (s) => s.books.length,
|
||||||
|
sequence: (s) => null,
|
||||||
|
shelf: (s) => s.books.length,
|
||||||
|
author: (s) => s.items?.length,
|
||||||
orElse: () => null,
|
orElse: () => null,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue