Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Fix bookmark sync crash and card overflow in Find Missing Books

Nathan Poulson9fc4b5e35dfe
diff --git a/lib/services/api_service.dart b/lib/services/api_service.dart
index 5238c344..b5fd6e68 100644
--- a/lib/services/api_service.dart
+++ b/lib/services/api_service.dart
@@ -941,7 +941,7 @@ class ApiService {
if (progress != null) {
final bookmarks = progress['bookmarks'] as List<dynamic>?;
if (bookmarks != null && bookmarks.isNotEmpty) {
- return bookmarks.cast<Map<String, dynamic>>();
+ return bookmarks.whereType<Map<String, dynamic>>().toList();
}
}
// Fall back to user object - bookmarks may be stored there
diff --git a/lib/services/bookmark_service.dart b/lib/services/bookmark_service.dart
index bedd5ee2..f9c0f908 100644
--- a/lib/services/bookmark_service.dart
+++ b/lib/services/bookmark_service.dart
@@ -273,7 +273,7 @@ class BookmarkService {
final kept = <Bookmark>[];
bool changed = false;
for (final lb in refreshedLocal) {
- final serverMatch = serverBookmarks.where((sb) =>
+ final serverMatch = serverBookmarks.whereType<Map<String, dynamic>>().where((sb) =>
posMatch((sb['time'] as num?)?.toDouble() ?? 0, lb.positionSeconds)).firstOrNull;
if (serverMatch != null) {
kept.add(lb);
diff --git a/lib/widgets/audible_series_sheet.dart b/lib/widgets/audible_series_sheet.dart
index 7890f2d9..e6bb300b 100644
--- a/lib/widgets/audible_series_sheet.dart
+++ b/lib/widgets/audible_series_sheet.dart
@@ -265,8 +265,7 @@ class _AudibleSeriesSheetState extends State<AudibleSeriesSheet> {
clipBehavior: Clip.antiAlias,
child: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 100),
- child: IntrinsicHeight(
- child: Row(children: [
+ child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
// Cover - keep square regardless of row height
Align(
alignment: Alignment.topLeft,
@@ -359,7 +358,6 @@ class _AudibleSeriesSheetState extends State<AudibleSeriesSheet> {
),
),
]),
- ),
),
),
);