Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Open Goodreads book page directly, bump to 1.8.11+41

Nathan Poulsona5fdb9ac5568
diff --git a/lib/widgets/book_detail_sheet.dart b/lib/widgets/book_detail_sheet.dart
index ecb90ce2..06576ab3 100644
--- a/lib/widgets/book_detail_sheet.dart
+++ b/lib/widgets/book_detail_sheet.dart
@@ -933,8 +933,19 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {
}
void _openGoodreads(String title, String author) async {
- final q = author.isNotEmpty ? '$title $author' : title;
- final uri = Uri.https('www.goodreads.com', '/search', {'q': q});
+ final metadata = (_item?['media'] as Map<String, dynamic>?)?['metadata'] as Map<String, dynamic>? ?? {};
+ final isbn = metadata['isbn'] as String? ?? '';
+ final asin = metadata['asin'] as String? ?? '';
+ // ISBN goes directly to the book page; ASIN is a close second; search as fallback
+ final Uri uri;
+ if (isbn.isNotEmpty) {
+ uri = Uri.https('www.goodreads.com', '/book/isbn/$isbn');
+ } else if (asin.isNotEmpty) {
+ uri = Uri.https('www.goodreads.com', '/search', {'q': asin});
+ } else {
+ final q = author.isNotEmpty ? '$title $author' : title;
+ uri = Uri.https('www.goodreads.com', '/search', {'q': q});
+ }
try {
// Open in Goodreads app if installed
if (!await launchUrl(uri, mode: LaunchMode.externalNonBrowserApplication)) {
diff --git a/pubspec.yaml b/pubspec.yaml
index 9abead88..e4441ce3 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,7 +1,7 @@
name: absorb
description: A Material 3 Audiobookshelf client.
publish_to: 'none'
-version: 1.8.10+40
+version: 1.8.11+41
environment:
sdk: '>=3.1.0 <4.0.0'