Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions client/lib/models/book.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ class Book {

// Series
final String? seriesId;
final int? seriesNumber;
final String? seriesName;
final double? seriesNumber;
Comment on lines 111 to +113
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seriesNumber was changed from int? to double?, but there are existing Book(...) constructions (e.g. in client/lib/data/sample_data.dart) that pass integer literals like seriesNumber: 1, which will no longer type-check and will break the build. Update those call sites to pass doubles (e.g. 1.0) or cast/convert appropriately, and consider whether 0 is still a valid sentinel value now that this is a double?.

Copilot uses AI. Check for mistakes.

// Timestamps
final DateTime addedAt;
Expand Down Expand Up @@ -147,6 +148,7 @@ class Book {
this.rating,
this.customMetadata,
this.seriesId,
this.seriesName,
this.seriesNumber,
required this.addedAt,
this.startedAt,
Expand Down Expand Up @@ -226,7 +228,8 @@ class Book {
int? rating,
Map<String, dynamic>? customMetadata,
String? seriesId,
int? seriesNumber,
String? seriesName,
double? seriesNumber,
DateTime? addedAt,
DateTime? startedAt,
DateTime? completedAt,
Expand Down Expand Up @@ -262,6 +265,7 @@ class Book {
rating: rating ?? this.rating,
customMetadata: customMetadata ?? this.customMetadata,
seriesId: seriesId ?? this.seriesId,
seriesName: seriesName ?? this.seriesName,
seriesNumber: seriesNumber ?? this.seriesNumber,
addedAt: addedAt ?? this.addedAt,
startedAt: startedAt ?? this.startedAt,
Expand All @@ -285,7 +289,7 @@ class Book {
'language': language,
'page_count': pageCount,
'description': description,
'cover_url': coverUrl,
'cover_image_url': coverUrl,
'file_path': filePath,
'file_format': fileFormat?.name,
'file_size': fileSize,
Expand All @@ -302,6 +306,7 @@ class Book {
'rating': rating,
'custom_metadata': customMetadata,
'series_id': seriesId,
'series_name': seriesName,
'series_number': seriesNumber,
'added_at': addedAt.toIso8601String(),
'started_at': startedAt?.toIso8601String(),
Expand Down Expand Up @@ -331,7 +336,7 @@ class Book {
language: json['language'] as String?,
pageCount: json['page_count'] as int?,
description: json['description'] as String?,
coverUrl: json['cover_url'] as String?,
coverUrl: json['cover_image_url'] as String?,
filePath: json['file_path'] as String?,
fileFormat: json['file_format'] != null
? BookFormat.values.byName(json['file_format'] as String)
Expand All @@ -354,7 +359,8 @@ class Book {
rating: json['rating'] as int?,
customMetadata: json['custom_metadata'] as Map<String, dynamic>?,
seriesId: json['series_id'] as String?,
seriesNumber: json['series_number'] as int?,
seriesName: json['series_name'] as String?,
seriesNumber: (json['series_number'] as num?)?.toDouble(),
addedAt: DateTime.parse(json['added_at'] as String),
startedAt: json['started_at'] != null
? DateTime.parse(json['started_at'] as String)
Expand Down
12 changes: 9 additions & 3 deletions client/lib/pages/book_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class _BookDetailsPageState extends State<BookDetailsPage>
children: [
// Back navigation
Container(
height: 48,
height: ComponentSizes.appBarHeight + 1,
padding: const EdgeInsets.symmetric(horizontal: Spacing.md),
decoration: BoxDecoration(
border: Border(
Expand All @@ -180,8 +180,14 @@ class _BookDetailsPageState extends State<BookDetailsPage>
children: [
TextButton.icon(
onPressed: () => context.go('/library/books'),
icon: const Icon(Icons.arrow_back),
label: const Text('Back to library'),
style: TextButton.styleFrom(
foregroundColor: colorScheme.onSurface,
),
icon: const Icon(Icons.arrow_back, size: 20),
label: Text(
'Library',
style: Theme.of(context).textTheme.titleMedium,
),
),
],
),
Expand Down
Loading