Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Make the bookmark editor roomier with time nudging and a listen button

Barnabas615c6af5af5b
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index 224c6c2e..466d625f 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -464,6 +464,7 @@
},
"autoDownloadQueueOffSubtitle": "Off - manual downloads only",
"sectionPlayback": "Playback",
+ "sectionMediaControls": "Media Controls",
"defaultSpeed": "Default speed",
"defaultSpeedSubtitle": "New books start at this speed - each book remembers its own",
"skipBack": "Skip back",
@@ -476,6 +477,9 @@
"speedBookmarkInControls": "Speed & bookmark in media controls",
"speedBookmarkOnSubtitle": "On - notification shows speed & bookmark; chapter skip stays in Android Auto",
"speedBookmarkOffSubtitle": "Off - notification shows chapter skip; speed & bookmark stay in Android Auto",
+ "lockSeekBar": "Lock the seek bar",
+ "lockSeekBarOnSubtitle": "On - the scrubber in the notification, lockscreen and car shows progress but can't be dragged",
+ "lockSeekBarOffSubtitle": "Off - drag the scrubber in the notification, lockscreen and car to jump around",
"autoRewindOnResume": "Auto-rewind on resume",
"autoRewindOnSubtitle": "On - {min}s to {max}s based on pause length",
"@autoRewindOnSubtitle": {
@@ -802,6 +806,20 @@
"logOutTitle": "Log out?",
"logOutContent": "This will sign you out. Your downloads will stay on this device.",
"signOut": "Sign Out",
+ "editServerAddressTitle": "Edit Server Address",
+ "editServerAddressSubtitle": "Update the address for {username}. Use this if your server's address changed - it's still the same server, just a new URL. Your stats and downloads are kept.",
+ "@editServerAddressSubtitle": {
+ "placeholders": {
+ "username": {
+ "type": "String"
+ }
+ }
+ },
+ "editServerAddressField": "Server Address",
+ "editServerAddressUpdated": "Server address updated",
+ "editServerAddressFailed": "Couldn't update server address",
+ "editServerAddressAction": "Edit server address",
+ "removeAccountAction": "Remove account",
"removeAccountTitle": "Remove Account?",
"removeAccountContent": "Remove {username} on {server} from saved accounts?\n\nYou can always add it back later by signing in again.",
"@removeAccountContent": {
@@ -1848,6 +1866,18 @@
}
},
"adminUsersFailedDelete": "Failed to delete user",
+ "adminUsersUnlinkOpenId": "Unlink OpenID",
+ "adminUsersUnlinkOpenIdTitle": "Unlink OpenID?",
+ "adminUsersUnlinkOpenIdContent": "Remove the OpenID connection for {name}? They'll need to sign in with OpenID again to re-link.",
+ "@adminUsersUnlinkOpenIdContent": {
+ "placeholders": {
+ "name": {
+ "type": "String"
+ }
+ }
+ },
+ "adminUsersOpenIdUnlinked": "OpenID unlinked",
+ "adminUsersFailedUnlinkOpenId": "Failed to unlink OpenID",
"adminUsersByAuthor": "by {author}",
"@adminUsersByAuthor": {
"placeholders": {
@@ -3497,5 +3527,8 @@
}
},
"endOfEpisode": "End of Episode",
- "sleepTimerSheetEpisodeSleepStart": "Sleep at end of episode"
+ "sleepTimerSheetEpisodeSleepStart": "Sleep at end of episode",
+ "bookmarkListen": "Listen",
+ "bookmarkPause": "Pause",
+ "bookmarkPreviewFailed": "Couldn't play this spot."
}
diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart
index ff98c446..2539b54e 100644
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@ -1882,6 +1882,12 @@ abstract class AppLocalizations {
/// **'Playback'**
String get sectionPlayback;
+ /// No description provided for @sectionMediaControls.
+ ///
+ /// In en, this message translates to:
+ /// **'Media Controls'**
+ String get sectionMediaControls;
+
/// No description provided for @defaultSpeed.
///
/// In en, this message translates to:
@@ -1954,6 +1960,24 @@ abstract class AppLocalizations {
/// **'Off - notification shows chapter skip; speed & bookmark stay in Android Auto'**
String get speedBookmarkOffSubtitle;
+ /// No description provided for @lockSeekBar.
+ ///
+ /// In en, this message translates to:
+ /// **'Lock the seek bar'**
+ String get lockSeekBar;
+
+ /// No description provided for @lockSeekBarOnSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged'**
+ String get lockSeekBarOnSubtitle;
+
+ /// No description provided for @lockSeekBarOffSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Off - drag the scrubber in the notification, lockscreen and car to jump around'**
+ String get lockSeekBarOffSubtitle;
+
/// No description provided for @autoRewindOnResume.
///
/// In en, this message translates to:
@@ -2962,6 +2986,48 @@ abstract class AppLocalizations {
/// **'Sign Out'**
String get signOut;
+ /// No description provided for @editServerAddressTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Edit Server Address'**
+ String get editServerAddressTitle;
+
+ /// No description provided for @editServerAddressSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Update the address for {username}. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.'**
+ String editServerAddressSubtitle(String username);
+
+ /// No description provided for @editServerAddressField.
+ ///
+ /// In en, this message translates to:
+ /// **'Server Address'**
+ String get editServerAddressField;
+
+ /// No description provided for @editServerAddressUpdated.
+ ///
+ /// In en, this message translates to:
+ /// **'Server address updated'**
+ String get editServerAddressUpdated;
+
+ /// No description provided for @editServerAddressFailed.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t update server address'**
+ String get editServerAddressFailed;
+
+ /// No description provided for @editServerAddressAction.
+ ///
+ /// In en, this message translates to:
+ /// **'Edit server address'**
+ String get editServerAddressAction;
+
+ /// No description provided for @removeAccountAction.
+ ///
+ /// In en, this message translates to:
+ /// **'Remove account'**
+ String get removeAccountAction;
+
/// No description provided for @removeAccountTitle.
///
/// In en, this message translates to:
@@ -6209,6 +6275,36 @@ abstract class AppLocalizations {
/// **'Failed to delete user'**
String get adminUsersFailedDelete;
+ /// No description provided for @adminUsersUnlinkOpenId.
+ ///
+ /// In en, this message translates to:
+ /// **'Unlink OpenID'**
+ String get adminUsersUnlinkOpenId;
+
+ /// No description provided for @adminUsersUnlinkOpenIdTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Unlink OpenID?'**
+ String get adminUsersUnlinkOpenIdTitle;
+
+ /// No description provided for @adminUsersUnlinkOpenIdContent.
+ ///
+ /// In en, this message translates to:
+ /// **'Remove the OpenID connection for {name}? They\'ll need to sign in with OpenID again to re-link.'**
+ String adminUsersUnlinkOpenIdContent(String name);
+
+ /// No description provided for @adminUsersOpenIdUnlinked.
+ ///
+ /// In en, this message translates to:
+ /// **'OpenID unlinked'**
+ String get adminUsersOpenIdUnlinked;
+
+ /// No description provided for @adminUsersFailedUnlinkOpenId.
+ ///
+ /// In en, this message translates to:
+ /// **'Failed to unlink OpenID'**
+ String get adminUsersFailedUnlinkOpenId;
+
/// No description provided for @adminUsersByAuthor.
///
/// In en, this message translates to:
@@ -10079,6 +10175,24 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Sleep at end of episode'**
String get sleepTimerSheetEpisodeSleepStart;
+
+ /// No description provided for @bookmarkListen.
+ ///
+ /// In en, this message translates to:
+ /// **'Listen'**
+ String get bookmarkListen;
+
+ /// No description provided for @bookmarkPause.
+ ///
+ /// In en, this message translates to:
+ /// **'Pause'**
+ String get bookmarkPause;
+
+ /// No description provided for @bookmarkPreviewFailed.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t play this spot.'**
+ String get bookmarkPreviewFailed;
}
class _AppLocalizationsDelegate
diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart
index bec86a64..873b1a6f 100644
--- a/lib/l10n/app_localizations_de.dart
+++ b/lib/l10n/app_localizations_de.dart
@@ -974,6 +974,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get sectionPlayback => 'Wiedergabe';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Standardgeschwindigkeit';
@@ -1018,6 +1021,17 @@ class AppLocalizationsDe extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-Zurückspulen beim Fortsetzen';
@@ -1607,6 +1621,29 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get signOut => 'Abmelden';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Konto entfernen?';
@@ -3434,6 +3471,23 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Benutzer konnte nicht gelöscht werden';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'von $author';
@@ -5839,4 +5893,13 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dart
index f78cb5f5..dd5754ea 100644
--- a/lib/l10n/app_localizations_el.dart
+++ b/lib/l10n/app_localizations_el.dart
@@ -966,6 +966,9 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsEl extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart
index c2559c9e..c290fac1 100644
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@ -966,6 +966,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsEn extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart
index af144616..632a3467 100644
--- a/lib/l10n/app_localizations_es.dart
+++ b/lib/l10n/app_localizations_es.dart
@@ -966,6 +966,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsEs extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart
index 7c78944e..1d9a557c 100644
--- a/lib/l10n/app_localizations_fr.dart
+++ b/lib/l10n/app_localizations_fr.dart
@@ -968,6 +968,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1011,6 +1014,17 @@ class AppLocalizationsFr extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1590,6 +1604,29 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3399,6 +3436,23 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5774,4 +5828,13 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart
index 4cd37ca1..d0e31630 100644
--- a/lib/l10n/app_localizations_it.dart
+++ b/lib/l10n/app_localizations_it.dart
@@ -966,6 +966,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsIt extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart
index ca6f6929..2deba80b 100644
--- a/lib/l10n/app_localizations_ja.dart
+++ b/lib/l10n/app_localizations_ja.dart
@@ -966,6 +966,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsJa extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dart
index b90915dc..d2ccf808 100644
--- a/lib/l10n/app_localizations_no.dart
+++ b/lib/l10n/app_localizations_no.dart
@@ -966,6 +966,9 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsNo extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart
index 815ade85..9215cd3b 100644
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@ -966,6 +966,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsPt extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dart
index c08c3e5d..b42d8f10 100644
--- a/lib/l10n/app_localizations_ro.dart
+++ b/lib/l10n/app_localizations_ro.dart
@@ -966,6 +966,9 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get sectionPlayback => 'Playback';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1009,6 +1012,17 @@ class AppLocalizationsRo extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1588,6 +1602,29 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get signOut => 'Sign Out';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3397,6 +3434,23 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5772,4 +5826,13 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart
index bd5ca3b2..8c1adcd1 100644
--- a/lib/l10n/app_localizations_ru.dart
+++ b/lib/l10n/app_localizations_ru.dart
@@ -969,6 +969,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get sectionPlayback => 'Воспроизведение';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => 'Default speed';
@@ -1012,6 +1015,17 @@ class AppLocalizationsRu extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => 'Auto-rewind on resume';
@@ -1591,6 +1605,29 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get signOut => 'Выйти';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => 'Remove Account?';
@@ -3400,6 +3437,23 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5775,4 +5829,13 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart
index 8a6ad5f9..3a305c47 100644
--- a/lib/l10n/app_localizations_zh.dart
+++ b/lib/l10n/app_localizations_zh.dart
@@ -943,6 +943,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get sectionPlayback => '播放';
+ @override
+ String get sectionMediaControls => 'Media Controls';
+
@override
String get defaultSpeed => '默认速度';
@@ -983,6 +986,17 @@ class AppLocalizationsZh extends AppLocalizations {
String get speedBookmarkOffSubtitle =>
'Off - notification shows chapter skip; speed & bookmark stay in Android Auto';
+ @override
+ String get lockSeekBar => 'Lock the seek bar';
+
+ @override
+ String get lockSeekBarOnSubtitle =>
+ 'On - the scrubber in the notification, lockscreen and car shows progress but can\'t be dragged';
+
+ @override
+ String get lockSeekBarOffSubtitle =>
+ 'Off - drag the scrubber in the notification, lockscreen and car to jump around';
+
@override
String get autoRewindOnResume => '恢复播放时自动倒退';
@@ -1535,6 +1549,29 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get signOut => '退出登录';
+ @override
+ String get editServerAddressTitle => 'Edit Server Address';
+
+ @override
+ String editServerAddressSubtitle(String username) {
+ return 'Update the address for $username. Use this if your server\'s address changed - it\'s still the same server, just a new URL. Your stats and downloads are kept.';
+ }
+
+ @override
+ String get editServerAddressField => 'Server Address';
+
+ @override
+ String get editServerAddressUpdated => 'Server address updated';
+
+ @override
+ String get editServerAddressFailed => 'Couldn\'t update server address';
+
+ @override
+ String get editServerAddressAction => 'Edit server address';
+
+ @override
+ String get removeAccountAction => 'Remove account';
+
@override
String get removeAccountTitle => '移除账户?';
@@ -3323,6 +3360,23 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get adminUsersFailedDelete => 'Failed to delete user';
+ @override
+ String get adminUsersUnlinkOpenId => 'Unlink OpenID';
+
+ @override
+ String get adminUsersUnlinkOpenIdTitle => 'Unlink OpenID?';
+
+ @override
+ String adminUsersUnlinkOpenIdContent(String name) {
+ return 'Remove the OpenID connection for $name? They\'ll need to sign in with OpenID again to re-link.';
+ }
+
+ @override
+ String get adminUsersOpenIdUnlinked => 'OpenID unlinked';
+
+ @override
+ String get adminUsersFailedUnlinkOpenId => 'Failed to unlink OpenID';
+
@override
String adminUsersByAuthor(String author) {
return 'by $author';
@@ -5695,4 +5749,13 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get sleepTimerSheetEpisodeSleepStart => 'Sleep at end of episode';
+
+ @override
+ String get bookmarkListen => 'Listen';
+
+ @override
+ String get bookmarkPause => 'Pause';
+
+ @override
+ String get bookmarkPreviewFailed => 'Couldn\'t play this spot.';
}
diff --git a/lib/screens/bookmarks_screen.dart b/lib/screens/bookmarks_screen.dart
index 3de752b0..52a07eaa 100644
--- a/lib/screens/bookmarks_screen.dart
+++ b/lib/screens/bookmarks_screen.dart
@@ -9,6 +9,7 @@ import '../screens/app_shell.dart';
import '../services/audio_player_service.dart';
import '../services/bookmark_service.dart';
import '../services/scoped_prefs.dart';
+import '../widgets/bookmark_detail_dialog.dart';
import '../widgets/card_buttons.dart';
import '../services/download_service.dart';
import '../widgets/absorb_page_header.dart';
@@ -259,96 +260,38 @@ class _BookmarksScreenState extends State<BookmarksScreen> {
return null;
}
- Future<void> _editBookmark(String itemId, Bookmark bookmark) async {
- final l = AppLocalizations.of(context)!;
- final titleC = TextEditingController(text: bookmark.title);
- final noteC = TextEditingController(text: bookmark.note ?? '');
- final result = await showDialog<Map<String, String>>(context: context, builder: (ctx) => AlertDialog(
- title: Text(l.editBookmark),
- content: Column(mainAxisSize: MainAxisSize.min, children: [
- TextField(controller: titleC, decoration: InputDecoration(labelText: l.titleLabel, border: const OutlineInputBorder())),
- const SizedBox(height: 12),
- TextField(controller: noteC, maxLines: 3, decoration: InputDecoration(labelText: l.noteOptionalLabel, border: const OutlineInputBorder(), alignLabelWithHint: true)),
- ]),
- actions: [
- TextButton(onPressed: () => Navigator.pop(ctx), child: Text(l.cancel)),
- FilledButton(onPressed: () => Navigator.pop(ctx, {'title': titleC.text, 'note': noteC.text}), child: Text(l.save)),
- ],
- ));
- if (result != null && result['title']!.isNotEmpty) {
- await BookmarkService().updateBookmark(
- itemId: itemId, bookmarkId: bookmark.id,
- title: result['title']!, note: result['note']?.isNotEmpty == true ? result['note'] : null,
- api: context.read<AuthProvider>().apiService,
- );
- _load();
- }
- }
-
Future<void> _jumpToBookmark(String itemId, Bookmark bookmark, String bookTitle) async {
- final cs = Theme.of(context).colorScheme;
- final tt = Theme.of(context).textTheme;
final l = AppLocalizations.of(context)!;
- final action = await showDialog<String>(
+ final api = context.read<AuthProvider>().apiService;
+ final result = await showDialog<BookmarkDetailResult>(
context: context,
- builder: (ctx) => AlertDialog(
- icon: const Icon(Icons.bookmark_rounded),
- title: Text(bookmark.title, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w600)),
- content: Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [
- if (bookmark.note != null && bookmark.note!.isNotEmpty) ...[
- Container(
- width: double.infinity,
- padding: const EdgeInsets.all(12),
- decoration: BoxDecoration(
- color: cs.onSurface.withValues(alpha: 0.04),
- borderRadius: BorderRadius.circular(10),
- ),
- child: Text(bookmark.note!, style: tt.bodyMedium?.copyWith(color: cs.onSurfaceVariant, height: 1.4)),
- ),
- const SizedBox(height: 12),
- ],
- Text(l.bookmarksScreenPositionInBook(bookmark.formattedPosition, bookTitle),
- style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6))),
- ]),
- actions: [
- TextButton(
- onPressed: () => Navigator.pop(ctx),
- child: Text(l.bookmarksScreenClose),
- ),
- TextButton(
- onPressed: () => Navigator.pop(ctx, 'edit'),
- child: Text(l.edit),
- ),
- FilledButton(
- onPressed: () => Navigator.pop(ctx, 'jump'),
- child: Text(l.bookmarksJump),
- ),
- ],
+ builder: (ctx) => BookmarkDetailDialog(
+ itemId: itemId,
+ bookmark: bookmark,
+ api: api,
),
);
+ if (!mounted) return;
- if (action == 'edit') {
- await _editBookmark(itemId, bookmark);
+ // Anything other than Jump just reflects saved title/note/time edits.
+ if (result == null || result.action != 'jump') {
+ _load();
return;
}
- if (action != 'jump' || !mounted) return;
-
- // Read providers before async gaps
+ final position = result.position;
final lib = context.read<LibraryProvider>();
- final api = context.read<AuthProvider>().apiService;
final player = AudioPlayerService();
- // If the same book is already loaded, just seek
+ // Same book already loaded: just seek.
if (player.currentItemId == itemId) {
- await player.seekTo(Duration(seconds: bookmark.positionSeconds.round()));
+ await player.seekTo(Duration(seconds: position.round()));
if (!player.isPlaying) player.play();
if (mounted) Navigator.pop(context);
AppShell.goToAbsorbingGlobal();
return;
}
- // Otherwise load the book from API
if (api == null) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
@@ -387,7 +330,7 @@ class _BookmarksScreenState extends State<BookmarksScreen> {
coverUrl: coverUrl,
totalDuration: duration,
chapters: chapters,
- startTime: bookmark.positionSeconds,
+ startTime: position,
forceStartTime: true,
);
if (error != null && mounted) showErrorSnackBar(context, error);
diff --git a/lib/services/bookmark_preview_player.dart b/lib/services/bookmark_preview_player.dart
new file mode 100644
index 00000000..acd6d12b
--- /dev/null
+++ b/lib/services/bookmark_preview_player.dart
@@ -0,0 +1,232 @@
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:flutter/foundation.dart';
+import 'package:just_audio/just_audio.dart';
+
+import 'api_service.dart';
+import 'audio_player_service.dart';
+import 'download_service.dart';
+
+/// Auditions a book at a given position WITHOUT moving the user's real playback
+/// position. Resolves audio for ANY book - downloaded (local files) or streamed
+/// (per-file URLs built on demand). Pauses the main player while auditioning and
+/// restores it on stop/dispose. Owned by the bookmark detail dialog.
+class BookmarkPreviewPlayer extends ChangeNotifier {
+ BookmarkPreviewPlayer({required this.itemId, this.api});
+
+ final String itemId;
+ final ApiService? api;
+
+ AudioPlayer? _player;
+ StreamSubscription<PlayerState>? _stateSub;
+ bool _loading = false;
+ bool _playing = false;
+ bool _disposed = false;
+ bool? _mainWasPlaying;
+ Timer? _autoStop;
+
+ /// The audition auto-stops after this long so a single tap never plays the
+ /// rest of the book (a single-file m4b would otherwise run for hours). Plenty
+ /// for a bookmark preview; easy to bump or wire to a setting.
+ static const Duration _autoStopAfter = Duration(seconds: 60);
+
+ // (source path/url, track duration seconds, isLocal) resolved once per book.
+ List<({String source, double duration, bool local})>? _tracks;
+
+ bool get isLoading => _loading;
+ bool get isPlaying => _playing;
+
+ /// Toggle playback at [globalSeconds]. Pauses if playing, resumes if paused,
+ /// otherwise loads + plays from that position. Throws on resolve/playback
+ /// failure so the UI can show a message.
+ Future<void> toggleAt(double globalSeconds) async {
+ final p = _player;
+ if (p != null) {
+ if (p.playing) {
+ _autoStop?.cancel();
+ await p.pause();
+ } else {
+ _pauseMain();
+ _startAutoStop();
+ await p.play();
+ }
+ return;
+ }
+ await _playAt(globalSeconds);
+ }
+
+ Future<void> _playAt(double globalSeconds) async {
+ _loading = true;
+ notifyListeners();
+ _pauseMain();
+
+ final tracks = await _resolveTracks();
+ if (_disposed) return;
+ if (tracks == null || tracks.isEmpty) {
+ debugPrint('[BookmarkPreview] $itemId: no tracks resolved');
+ _loading = false;
+ notifyListeners();
+ throw StateError('no audio for $itemId');
+ }
+
+ // Map the global position to a track + local offset.
+ var acc = 0.0;
+ var idx = tracks.length - 1;
+ var local = globalSeconds;
+ for (var i = 0; i < tracks.length; i++) {
+ if (globalSeconds < acc + tracks[i].duration || i == tracks.length - 1) {
+ idx = i;
+ final upper = tracks[i].duration > 0 ? tracks[i].duration : globalSeconds;
+ local = (globalSeconds - acc).clamp(0.0, upper);
+ break;
+ }
+ acc += tracks[i].duration;
+ }
+ final track = tracks[idx];
+ debugPrint('[BookmarkPreview] $itemId: play ${globalSeconds.toStringAsFixed(1)}s -> '
+ 'track[$idx] ${track.local ? "local" : "stream"} @${local.toStringAsFixed(1)}s');
+
+ try {
+ await _disposePlayer();
+ // Match the main player: no localhost proxy on Android. The proxy was
+ // aborting large seeks into single-file streamed books ("Connection
+ // aborted"); without it ExoPlayer ranges the server directly. Token auth
+ // rides in the URL (buildFileUrl), so streaming still authenticates.
+ final player = AudioPlayer(useProxyForRequestHeaders: false);
+ _player = player;
+ _stateSub = player.playerStateStream.listen((s) {
+ if (_disposed) return;
+ final done = s.processingState == ProcessingState.completed;
+ _loading = s.processingState == ProcessingState.loading ||
+ s.processingState == ProcessingState.buffering;
+ _playing = s.playing && !done;
+ notifyListeners();
+ if (done) player.pause();
+ });
+ if (track.local) {
+ await player.setAudioSource(AudioSource.file(track.source));
+ } else {
+ await player.setAudioSource(
+ AudioSource.uri(Uri.parse(track.source), headers: api?.mediaHeaders));
+ }
+ await player.seek(Duration(milliseconds: (local * 1000).round()));
+ // Start the auto-stop BEFORE awaiting play(): just_audio's play() future
+ // doesn't complete until playback ends, so a timer after it never armed -
+ // that's why the 60s cap wasn't firing.
+ _startAutoStop();
+ await player.play();
+ } catch (e) {
+ debugPrint('[BookmarkPreview] $itemId: playback error: $e');
+ _loading = false;
+ notifyListeners();
+ rethrow;
+ }
+ }
+
+ Future<List<({String source, double duration, bool local})>?> _resolveTracks() async {
+ if (_tracks != null) return _tracks;
+
+ // Downloaded book: local files + cached track durations.
+ final localPaths = DownloadService().getLocalPaths(itemId);
+ final sessionRaw = DownloadService().getCachedSessionData(itemId);
+ if (localPaths != null && localPaths.isNotEmpty && sessionRaw != null) {
+ try {
+ final session = jsonDecode(sessionRaw) as Map<String, dynamic>;
+ final audioTracks = session['audioTracks'] as List<dynamic>?;
+ if (audioTracks != null && audioTracks.length == localPaths.length) {
+ _tracks = [
+ for (var i = 0; i < localPaths.length; i++)
+ (
+ source: localPaths[i],
+ duration: ((audioTracks[i] as Map<String, dynamic>)['duration'] as num?)?.toDouble() ?? 0,
+ local: true,
+ ),
+ ];
+ debugPrint('[BookmarkPreview] $itemId: ${_tracks!.length} local track(s)');
+ return _tracks;
+ }
+ } catch (_) {}
+ }
+
+ // Streamed book: build per-file URLs from the library item.
+ if (api == null) {
+ debugPrint('[BookmarkPreview] $itemId: no api (not downloaded, not logged in?)');
+ return null;
+ }
+ final item = await api!.getLibraryItem(itemId);
+ if (item == null) {
+ debugPrint('[BookmarkPreview] $itemId: getLibraryItem returned null');
+ return null;
+ }
+ final media = item['media'] as Map<String, dynamic>? ?? {};
+ final audioFiles = ((media['audioFiles'] as List<dynamic>?) ?? const [])
+ .whereType<Map<String, dynamic>>()
+ .toList()
+ ..sort((a, b) => ((a['index'] as num?) ?? 0).compareTo((b['index'] as num?) ?? 0));
+ if (audioFiles.isEmpty) {
+ debugPrint('[BookmarkPreview] $itemId: library item has no audioFiles');
+ return null;
+ }
+ _tracks = [
+ for (final af in audioFiles)
+ (
+ source: api!.buildFileUrl(itemId, af['ino']?.toString() ?? ''),
+ duration: (af['duration'] as num?)?.toDouble() ?? 0,
+ local: false,
+ ),
+ ];
+ debugPrint('[BookmarkPreview] $itemId: ${_tracks!.length} streamed track(s)');
+ return _tracks;
+ }
+
+ void _pauseMain() {
+ final main = AudioPlayerService();
+ _mainWasPlaying ??= main.isPlaying;
+ if (main.isPlaying) main.pause();
+ }
+
+ void _startAutoStop() {
+ _autoStop?.cancel();
+ _autoStop = Timer(_autoStopAfter, () {
+ debugPrint('[BookmarkPreview] auto-stop after ${_autoStopAfter.inSeconds}s');
+ _player?.pause();
+ });
+ }
+
+ Future<void> _disposePlayer() async {
+ _autoStop?.cancel();
+ _autoStop = null;
+ await _stateSub?.cancel();
+ _stateSub = null;
+ final p = _player;
+ _player = null;
+ _playing = false;
+ if (p != null) {
+ try {
+ await p.stop();
+ await p.dispose();
+ } catch (_) {}
+ }
+ }
+
+ /// Stop the audition and resume the main player if we had paused it.
+ Future<void> stop() async {
+ await _disposePlayer();
+ if (_mainWasPlaying == true) {
+ _mainWasPlaying = null;
+ await AudioPlayerService().play();
+ }
+ if (!_disposed) notifyListeners();
+ }
+
+ @override
+ void dispose() {
+ _disposed = true;
+ _autoStop?.cancel();
+ _stateSub?.cancel();
+ _player?.dispose();
+ if (_mainWasPlaying == true) AudioPlayerService().play();
+ super.dispose();
+ }
+}
diff --git a/lib/services/bookmark_service.dart b/lib/services/bookmark_service.dart
index 4746116b..f05fdcc0 100644
--- a/lib/services/bookmark_service.dart
+++ b/lib/services/bookmark_service.dart
@@ -64,9 +64,12 @@ class Bookmark {
}
String get formattedPosition {
- final h = positionSeconds ~/ 3600;
- final m = (positionSeconds % 3600) ~/ 60;
- final s = positionSeconds.toInt() % 60;
+ // Guard against a negative stored position (e.g. a stray -1): Dart's modulo
+ // on negatives would otherwise render -1s as "59:59".
+ final p = positionSeconds < 0 ? 0.0 : positionSeconds;
+ final h = p ~/ 3600;
+ final m = (p % 3600) ~/ 60;
+ final s = p.toInt() % 60;
if (h > 0) {
return '$h:${m.toString().padLeft(2, '0')}:${s.toString().padLeft(2, '0')}';
}
@@ -252,6 +255,64 @@ class BookmarkService {
}
}
+ /// Move a bookmark to a new time. Updates locally and re-points the server
+ /// entry - ABS keys bookmarks by time, so moving is delete-old + create-new.
+ /// Falls back to the offline pending queues when the server can't be reached.
+ Future<void> moveBookmark({
+ required String itemId,
+ required String bookmarkId,
+ required double newPositionSeconds,
+ ApiService? api,
+ }) async {
+ final newPos = newPositionSeconds < 0 ? 0.0 : newPositionSeconds;
+ final key = '$_keyPrefix$itemId';
+ final stored = await ScopedPrefs.getStringList(key);
+
+ double? oldTime;
+ String? serverTitle;
+ final updated = <String>[];
+ for (final json in stored) {
+ try {
+ final bm = Bookmark.fromJson(jsonDecode(json));
+ if (bm.id == bookmarkId) {
+ oldTime = bm.positionSeconds;
+ serverTitle = bm.serverTitle;
+ updated.add(jsonEncode(Bookmark(
+ id: bm.id,
+ positionSeconds: newPos,
+ created: bm.created,
+ title: bm.title,
+ note: bm.note,
+ ).toJson()));
+ } else {
+ updated.add(json);
+ }
+ } catch (_) {
+ updated.add(json);
+ }
+ }
+ if (oldTime == null) return; // bookmark not found
+ await ScopedPrefs.setStringList(key, updated);
+ if ((oldTime - newPos).abs() < 0.05) return; // no real change
+
+ await _ensureHydrated();
+
+ // The old position's pending-create (if any) no longer applies.
+ _unpushed.remove('$itemId::${oldTime.toStringAsFixed(1)}');
+
+ bool deletedOk = false;
+ bool createdOk = false;
+ if (api != null) {
+ deletedOk = await api.deleteBookmark(itemId, time: oldTime);
+ createdOk = await api.createBookmark(itemId, time: newPos, title: serverTitle ?? '');
+ }
+ if (!deletedOk) _pendingDeletes.putIfAbsent(itemId, () => {}).add(oldTime);
+ if (!createdOk) _unpushed.add('$itemId::${newPos.toStringAsFixed(1)}');
+ await _persistUnpushed();
+ await _persistPendingDeletes();
+ debugPrint('[Bookmarks] Moved $bookmarkId: ${oldTime}s -> ${newPos}s');
+ }
+
/// Delete a bookmark.
Future<void> deleteBookmark({
required String itemId,
@@ -418,7 +479,18 @@ class BookmarkService {
for (final key in prefs.getKeys()) {
if (!key.startsWith(scopedPrefix)) continue;
final itemId = key.substring(scopedPrefix.length);
- final stored = prefs.getStringList(key) ?? [];
+ // The service's own offline-sync keys (bookmarks_pending_creates /
+ // bookmarks_pending_deletes) live under the same "bookmarks_" prefix but
+ // are Strings, not String lists. getStringList() throws on them, which
+ // used to leave the Bookmarks screen spinning forever for any account
+ // that had made offline bookmark changes. Skip them (and guard defensively).
+ if (itemId == 'pending_creates' || itemId == 'pending_deletes') continue;
+ final List<String> stored;
+ try {
+ stored = prefs.getStringList(key) ?? [];
+ } catch (_) {
+ continue;
+ }
final bookmarks = <Bookmark>[];
for (final json in stored) {
try {
diff --git a/lib/widgets/bookmark_detail_dialog.dart b/lib/widgets/bookmark_detail_dialog.dart
new file mode 100644
index 00000000..5f80775f
--- /dev/null
+++ b/lib/widgets/bookmark_detail_dialog.dart
@@ -0,0 +1,233 @@
+import 'package:flutter/material.dart';
+
+import '../l10n/app_localizations.dart';
+import '../services/api_service.dart';
+import '../services/bookmark_service.dart';
+import '../services/bookmark_preview_player.dart';
+
+/// Result of [BookmarkDetailDialog]. [action] is 'jump' (caller should seek
+/// there) or 'saved' (stay put, refresh). [position] is the possibly-nudged
+/// bookmark time in seconds. The dialog returns null when closed without saving.
+typedef BookmarkDetailResult = ({String action, double position});
+
+/// Rich bookmark detail editor shared by the standalone Bookmarks screen and the
+/// in-player bookmark sheet: roomy title/note, a -5/-1/+1/+5 fine time nudge
+/// (synced to the server), and inline preview playback that auditions the spot
+/// without moving the user's real position. Persists on Save/Jump, then pops a
+/// [BookmarkDetailResult].
+class BookmarkDetailDialog extends StatefulWidget {
+ final String itemId;
+ final Bookmark bookmark;
+ final ApiService? api;
+ const BookmarkDetailDialog({
+ super.key,
+ required this.itemId,
+ required this.bookmark,
+ this.api,
+ });
+
+ @override
+ State<BookmarkDetailDialog> createState() => _BookmarkDetailDialogState();
+}
+
+class _BookmarkDetailDialogState extends State<BookmarkDetailDialog> {
+ late final TextEditingController _titleC;
+ late final TextEditingController _noteC;
+ late double _seconds;
+ late final BookmarkPreviewPlayer _preview;
+ bool _saving = false;
+
+ @override
+ void initState() {
+ super.initState();
+ _titleC = TextEditingController(text: widget.bookmark.title);
+ _noteC = TextEditingController(text: widget.bookmark.note ?? '');
+ // Clamp a stray negative position to 0 so it shows 0:00 (not "59:59") and
+ // self-heals to 0 if the user saves.
+ _seconds = widget.bookmark.positionSeconds < 0 ? 0.0 : widget.bookmark.positionSeconds;
+ _preview = BookmarkPreviewPlayer(itemId: widget.itemId, api: widget.api)
+ ..addListener(_onPreview);
+ }
+
+ void _onPreview() {
+ if (mounted) setState(() {});
+ }
+
+ @override
+ void dispose() {
+ _preview.removeListener(_onPreview);
+ _preview.dispose();
+ _titleC.dispose();
+ _noteC.dispose();
+ super.dispose();
+ }
+
+ String _fmt(double s) {
+ final h = s ~/ 3600;
+ final m = (s % 3600) ~/ 60;
+ final sec = s.toInt() % 60;
+ if (h > 0) {
+ return '$h:${m.toString().padLeft(2, '0')}:${sec.toString().padLeft(2, '0')}';
+ }
+ return '$m:${sec.toString().padLeft(2, '0')}';
+ }
+
+ void _nudge(double delta) {
+ setState(() => _seconds = (_seconds + delta).clamp(0.0, double.infinity));
+ _preview.stop(); // next Listen uses the new time
+ }
+
+ Future<void> _togglePreview() async {
+ try {
+ await _preview.toggleAt(_seconds);
+ } catch (e) {
+ debugPrint('[BookmarkPreview] toggle failed: $e');
+ if (!mounted) return;
+ final l = AppLocalizations.of(context)!;
+ ScaffoldMessenger.of(context).showSnackBar(SnackBar(
+ content: Text(l.bookmarkPreviewFailed),
+ behavior: SnackBarBehavior.floating,
+ ));
+ }
+ }
+
+ Future<void> _persist() async {
+ setState(() => _saving = true);
+ await _preview.stop();
+ final newTitle =
+ _titleC.text.trim().isEmpty ? widget.bookmark.title : _titleC.text.trim();
+ final newNote = _noteC.text.trim();
+ final svc = BookmarkService();
+ await svc.updateBookmark(
+ itemId: widget.itemId,
+ bookmarkId: widget.bookmark.id,
+ title: newTitle,
+ note: newNote.isEmpty ? null : newNote,
+ api: widget.api,
+ );
+ if ((_seconds - widget.bookmark.positionSeconds).abs() >= 0.05) {
+ await svc.moveBookmark(
+ itemId: widget.itemId,
+ bookmarkId: widget.bookmark.id,
+ newPositionSeconds: _seconds,
+ api: widget.api,
+ );
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final l = AppLocalizations.of(context)!;
+ final tt = Theme.of(context).textTheme;
+ return AlertDialog(
+ scrollable: true,
+ title: Text(l.editBookmark),
+ content: SizedBox(
+ width: double.maxFinite,
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ TextField(
+ controller: _titleC,
+ decoration: InputDecoration(
+ labelText: l.titleLabel, border: const OutlineInputBorder()),
+ ),
+ const SizedBox(height: 12),
+ TextField(
+ controller: _noteC,
+ minLines: 4,
+ maxLines: 10,
+ keyboardType: TextInputType.multiline,
+ textCapitalization: TextCapitalization.sentences,
+ decoration: InputDecoration(
+ labelText: l.noteOptionalLabel,
+ border: const OutlineInputBorder(),
+ alignLabelWithHint: true,
+ ),
+ ),
+ const SizedBox(height: 16),
+ Row(children: [
+ _nudgeBtn('-5', () => _nudge(-5)),
+ _nudgeBtn('-1', () => _nudge(-1)),
+ Expanded(
+ child: Center(
+ child: Text(
+ _fmt(_seconds),
+ style: tt.titleMedium?.copyWith(
+ fontWeight: FontWeight.w600,
+ fontFeatures: [const FontFeature.tabularFigures()],
+ ),
+ ),
+ ),
+ ),
+ _nudgeBtn('+1', () => _nudge(1)),
+ _nudgeBtn('+5', () => _nudge(5)),
+ ]),
+ const SizedBox(height: 4),
+ Center(
+ child: TextButton.icon(
+ icon: _preview.isLoading
+ ? const SizedBox(
+ width: 18, height: 18,
+ child: CircularProgressIndicator(strokeWidth: 2))
+ : Icon(_preview.isPlaying
+ ? Icons.pause_rounded
+ : Icons.play_arrow_rounded),
+ label: Text(_preview.isPlaying ? l.bookmarkPause : l.bookmarkListen),
+ onPressed: _preview.isLoading ? null : _togglePreview,
+ ),
+ ),
+ ],
+ ),
+ ),
+ actions: [
+ TextButton(
+ onPressed: _saving
+ ? null
+ : () async {
+ await _preview.stop();
+ if (mounted) Navigator.pop(context);
+ },
+ child: Text(l.bookmarksScreenClose),
+ ),
+ TextButton(
+ onPressed: _saving
+ ? null
+ : () async {
+ await _persist();
+ if (mounted) {
+ Navigator.pop(context, (action: 'saved', position: _seconds));
+ }
+ },
+ child: Text(l.save),
+ ),
+ FilledButton(
+ onPressed: _saving
+ ? null
+ : () async {
+ await _persist();
+ if (mounted) {
+ Navigator.pop(context, (action: 'jump', position: _seconds));
+ }
+ },
+ child: Text(l.bookmarksJump),
+ ),
+ ],
+ );
+ }
+
+ Widget _nudgeBtn(String label, VoidCallback onTap) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 2),
+ child: OutlinedButton(
+ onPressed: onTap,
+ style: OutlinedButton.styleFrom(
+ padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 6),
+ minimumSize: const Size(44, 38),
+ ),
+ child: Text(label),
+ ),
+ );
+ }
+}
diff --git a/lib/widgets/card_buttons.dart b/lib/widgets/card_buttons.dart
index 6e4c08ec..ba0152e0 100644
--- a/lib/widgets/card_buttons.dart
+++ b/lib/widgets/card_buttons.dart
@@ -18,6 +18,7 @@ import '../services/sleep_timer_service.dart';
import 'absorb_slider.dart';
import 'absorbing_shared.dart';
import 'book_detail_sheet.dart';
+import 'bookmark_detail_dialog.dart';
import 'card_button_config.dart';
import 'card_chapters_sheet.dart';
import 'chromecast_button.dart';
@@ -840,19 +841,24 @@ class _SimpleBookmarkSheetState extends State<SimpleBookmarkSheet> {
final hasNote = bm.note != null && bm.note!.isNotEmpty;
return InkWell(
onTap: () async {
- final confirmed = await showDialog<bool>(context: ctx, builder: (dlg) => AlertDialog(
- title: Text(l.bookmarksJumpTitle),
- content: Text(l.bookmarksJumpShortContent(bm.title, bm.formattedPosition)),
- actions: [
- TextButton(onPressed: () => Navigator.pop(dlg, false), child: Text(l.cancel)),
- FilledButton(onPressed: () => Navigator.pop(dlg, true), child: Text(l.bookmarksJump)),
- ],
- ));
- if (confirmed != true || !ctx.mounted) return;
+ final result = await showDialog<BookmarkDetailResult>(
+ context: ctx,
+ builder: (_) => BookmarkDetailDialog(
+ itemId: widget.itemId,
+ bookmark: bm,
+ api: context.read<AuthProvider>().apiService,
+ ),
+ );
+ if (!ctx.mounted) return;
+ if (result == null || result.action != 'jump') {
+ _load(); // reflect any saved title/note/time edits
+ return;
+ }
+ final position = result.position;
final isActive = widget.player.currentItemId == widget.itemId;
Navigator.pop(ctx); // Close bookmark sheet first
if (isActive || _isCasting) {
- final seekDur = Duration(seconds: bm.positionSeconds.round());
+ final seekDur = Duration(seconds: position.round());
if (_isCasting) {
ChromecastService().seekTo(seekDur);
} else {
@@ -860,7 +866,7 @@ class _SimpleBookmarkSheetState extends State<SimpleBookmarkSheet> {
if (!widget.player.isPlaying) widget.player.play();
}
} else {
- await _startPlaybackAt(bm.positionSeconds);
+ await _startPlaybackAt(position);
}
},
onLongPress: () => _editBookmark(bm),