A cross platform Audiobookshelf client for Android and iOS
Dart
Show bookmark, history and chapter times at your playback speed
Barnabasc2c5509af2f4
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arbindex e0c91f73..5e0156bd 100644--- a/lib/l10n/app_en.arb+++ b/lib/l10n/app_en.arb@@ -613,7 +613,7 @@"cardScrubbersChapterSubtitle": "Only the chapter bar can seek","cardScrubbersLockedSubtitle": "Progress is shown without seeking","speedAdjustedTime": "Speed-adjusted time",- "speedAdjustedTimeOnSubtitle": "On - remaining time reflects playback speed",+ "speedAdjustedTimeOnSubtitle": "On - all times reflect your playback speed","speedAdjustedTimeOffSubtitle": "Off - showing raw audio duration","buttonLayout": "Button layout","buttonLayoutSubtitle": "How action buttons are arranged on the card",@@ -2050,14 +2050,6 @@}},"deleteBookmarkQuestion": "Delete bookmark?",- "bookmarkAtPosition": "Bookmark at {position}",- "@bookmarkAtPosition": {- "placeholders": {- "position": {- "type": "String"- }- }- },"cardIconsOnlyChip": "Icons only","cardMoreInGridChip": "\"More\" in grid","cardLayoutHidden": "Hidden",@@ -3497,7 +3489,7 @@"tipsSheetTapToSeekTitle": "Tap to Seek","tipsSheetTapToSeekDesc": "Tap anywhere on the chapter or book progress bar to jump directly to that position. You can also drag the bars for fine-grained control.","tipsSheetSpeedAdjustedTimeTitle": "Speed-Adjusted Time",- "tipsSheetSpeedAdjustedTimeDesc": "Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it'll actually take you.",+ "tipsSheetSpeedAdjustedTimeDesc": "Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they'll actually take you.","tipsSheetPlaybackHistoryTitle": "Playback History","tipsSheetPlaybackHistoryDesc": "Tap the History button on any card to see a timeline of every play, pause, seek, and speed change. Tap any event to jump back to that position.","tipsSheetAutoRewindTitle": "Auto-Rewind",diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dartindex 6407dfe6..7064b285 100644--- a/lib/l10n/app_localizations.dart+++ b/lib/l10n/app_localizations.dart@@ -2455,7 +2455,7 @@ abstract class AppLocalizations {/// No description provided for @speedAdjustedTimeOnSubtitle.////// In en, this message translates to:- /// **'On - remaining time reflects playback speed'**+ /// **'On - all times reflect your playback speed'**String get speedAdjustedTimeOnSubtitle;/// No description provided for @speedAdjustedTimeOffSubtitle.@@ -7172,12 +7172,6 @@ abstract class AppLocalizations {/// **'Delete bookmark?'**String get deleteBookmarkQuestion;- /// No description provided for @bookmarkAtPosition.- ///- /// In en, this message translates to:- /// **'Bookmark at {position}'**- String bookmarkAtPosition(String position);-/// No description provided for @cardIconsOnlyChip.////// In en, this message translates to:@@ -10350,7 +10344,7 @@ abstract class AppLocalizations {/// No description provided for @tipsSheetSpeedAdjustedTimeDesc.////// In en, this message translates to:- /// **'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.'**+ /// **'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.'**String get tipsSheetSpeedAdjustedTimeDesc;/// No description provided for @tipsSheetPlaybackHistoryTitle.diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dartindex 09a4196e..d9987110 100644--- a/lib/l10n/app_localizations_de.dart+++ b/lib/l10n/app_localizations_de.dart@@ -4003,11 +4003,6 @@ class AppLocalizationsDe extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Lesezeichen löschen?';- @override- String bookmarkAtPosition(String position) {- return 'Lesezeichen bei $position';- }-@overrideString get cardIconsOnlyChip => 'Nur Symbole';diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dartindex 5948fa7d..1d82cdce 100644--- a/lib/l10n/app_localizations_el.dart+++ b/lib/l10n/app_localizations_el.dart@@ -1288,7 +1288,7 @@ class AppLocalizationsEl extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3956,11 +3956,6 @@ class AppLocalizationsEl extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5904,7 +5899,7 @@ class AppLocalizationsEl extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dartindex 8c4fe546..5c2ea142 100644--- a/lib/l10n/app_localizations_en.dart+++ b/lib/l10n/app_localizations_en.dart@@ -1288,7 +1288,7 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3956,11 +3956,6 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5904,7 +5899,7 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dartindex 1ce97fbf..90d00757 100644--- a/lib/l10n/app_localizations_es.dart+++ b/lib/l10n/app_localizations_es.dart@@ -1290,7 +1290,7 @@ class AppLocalizationsEs extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3958,11 +3958,6 @@ class AppLocalizationsEs extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5906,7 +5901,7 @@ class AppLocalizationsEs extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dartindex a8bf0668..e95562c7 100644--- a/lib/l10n/app_localizations_fr.dart+++ b/lib/l10n/app_localizations_fr.dart@@ -3976,11 +3976,6 @@ class AppLocalizationsFr extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5924,7 +5919,7 @@ class AppLocalizationsFr extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dartindex 921abb3f..44079515 100644--- a/lib/l10n/app_localizations_it.dart+++ b/lib/l10n/app_localizations_it.dart@@ -1288,7 +1288,7 @@ class AppLocalizationsIt extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3956,11 +3956,6 @@ class AppLocalizationsIt extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5904,7 +5899,7 @@ class AppLocalizationsIt extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dartindex 5dadb58c..92a56d96 100644--- a/lib/l10n/app_localizations_ja.dart+++ b/lib/l10n/app_localizations_ja.dart@@ -1288,7 +1288,7 @@ class AppLocalizationsJa extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3956,11 +3956,6 @@ class AppLocalizationsJa extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5904,7 +5899,7 @@ class AppLocalizationsJa extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dartindex 17ab0af3..3ae93e59 100644--- a/lib/l10n/app_localizations_no.dart+++ b/lib/l10n/app_localizations_no.dart@@ -1288,7 +1288,7 @@ class AppLocalizationsNo extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3956,11 +3956,6 @@ class AppLocalizationsNo extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5904,7 +5899,7 @@ class AppLocalizationsNo extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dartindex 478f3358..29e41aba 100644--- a/lib/l10n/app_localizations_pt.dart+++ b/lib/l10n/app_localizations_pt.dart@@ -1288,7 +1288,7 @@ class AppLocalizationsPt extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3956,11 +3956,6 @@ class AppLocalizationsPt extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5904,7 +5899,7 @@ class AppLocalizationsPt extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dartindex 9d3b9943..56520ad0 100644--- a/lib/l10n/app_localizations_ro.dart+++ b/lib/l10n/app_localizations_ro.dart@@ -1288,7 +1288,7 @@ class AppLocalizationsRo extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3956,11 +3956,6 @@ class AppLocalizationsRo extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5904,7 +5899,7 @@ class AppLocalizationsRo extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dartindex b7d0825c..f5ca6b1f 100644--- a/lib/l10n/app_localizations_ru.dart+++ b/lib/l10n/app_localizations_ru.dart@@ -1290,7 +1290,7 @@ class AppLocalizationsRu extends AppLocalizations {@overrideString get speedAdjustedTimeOnSubtitle =>- 'On - remaining time reflects playback speed';+ 'On - all times reflect your playback speed';@overrideString get speedAdjustedTimeOffSubtitle => 'Off - showing raw audio duration';@@ -3960,11 +3960,6 @@ class AppLocalizationsRu extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => 'Icons only';@@ -5908,7 +5903,7 @@ class AppLocalizationsRu extends AppLocalizations {@overrideString get tipsSheetSpeedAdjustedTimeDesc =>- 'Time remaining and chapter times automatically adjust based on your playback speed. Listening at 1.5x? The time shown reflects how long it\'ll actually take you.';+ 'Every time shown - position, remaining, chapters, bookmarks - adjusts to your playback speed. Listening at 1.5x? The times shown reflect how long they\'ll actually take you.';@overrideString get tipsSheetPlaybackHistoryTitle => 'Playback History';diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dartindex bead7a8e..19dbe813 100644--- a/lib/l10n/app_localizations_zh.dart+++ b/lib/l10n/app_localizations_zh.dart@@ -3875,11 +3875,6 @@ class AppLocalizationsZh extends AppLocalizations {@overrideString get deleteBookmarkQuestion => 'Delete bookmark?';- @override- String bookmarkAtPosition(String position) {- return 'Bookmark at $position';- }-@overrideString get cardIconsOnlyChip => '仅图标';diff --git a/lib/screens/bookmarks_screen.dart b/lib/screens/bookmarks_screen.dartindex b57301d1..bcfc87c3 100644--- a/lib/screens/bookmarks_screen.dart+++ b/lib/screens/bookmarks_screen.dart@@ -31,6 +31,11 @@ class _BookmarksScreenState extends State<BookmarksScreen> {// Selected bookmarks as "itemId::bookmarkId" keysfinal Set<String> _selected = {};final Map<String, String> _titleCache = {};+ bool _speedAdjustedTime = true;+ // Per-book playback speed so each group's timestamps honor the+ // speed-adjusted-time setting at that book's own speed.+ final Map<String, double> _bookSpeeds = {};+ double _defaultSpeed = 1.0;static const _titleCacheKey = 'bookmark_book_titles';@@ -38,6 +43,30 @@ class _BookmarksScreenState extends State<BookmarksScreen> {void initState() {super.initState();_loadSort();+ PlayerSettings.getSpeedAdjustedTime().then((v) {+ if (mounted && v != _speedAdjustedTime) setState(() => _speedAdjustedTime = v);+ });+ }++ Future<void> _loadBookSpeeds() async {+ _defaultSpeed = await PlayerSettings.getDefaultSpeed();+ var changed = false;+ for (final itemId in _allBookmarks.keys) {+ if (_bookSpeeds.containsKey(itemId)) continue;+ final s = await PlayerSettings.getBookSpeed(itemId);+ if (s != null) {+ _bookSpeeds[itemId] = s;+ changed = true;+ }+ }+ if (mounted && changed) setState(() {});+ }++ double _displaySpeedFor(String itemId) {+ if (!_speedAdjustedTime) return 1.0;+ final player = AudioPlayerService();+ if (player.currentItemId == itemId) return player.speed;+ return _bookSpeeds[itemId] ?? _defaultSpeed;}Future<void> _loadSort() async {@@ -72,6 +101,7 @@ class _BookmarksScreenState extends State<BookmarksScreen> {Future<void> _load() async {final all = await BookmarkService().getAllBookmarks(sort: _sort);if (mounted) setState(() { _allBookmarks = all; _loading = false; });+ await _loadBookSpeeds();}Future<void> _syncAll() async {@@ -436,6 +466,7 @@ class _BookmarksScreenState extends State<BookmarksScreen> {coverUrl: coverUrl,mediaHeaders: lib.mediaHeaders,bookmarks: bookmarks,+ displaySpeed: _displaySpeedFor(itemId),cs: cs,tt: tt,selecting: _selecting,@@ -491,6 +522,7 @@ class _BookGroup extends StatelessWidget {final String? coverUrl;final Map<String, String> mediaHeaders;final List<Bookmark> bookmarks;+ final double displaySpeed;final ColorScheme cs;final TextTheme tt;final bool selecting;@@ -506,6 +538,7 @@ class _BookGroup extends StatelessWidget {this.coverUrl,this.mediaHeaders = const {},required this.bookmarks,+ this.displaySpeed = 1.0,required this.cs,required this.tt,required this.selecting,@@ -586,6 +619,7 @@ class _BookGroup extends StatelessWidget {_BookmarkRow(itemId: itemId,bookmark: bookmarks[j],+ displaySpeed: displaySpeed,cs: cs,tt: tt,selecting: selecting,@@ -637,6 +671,7 @@ class _BookGroup extends StatelessWidget {class _BookmarkRow extends StatelessWidget {final String itemId;final Bookmark bookmark;+ final double displaySpeed;final ColorScheme cs;final TextTheme tt;final bool selecting;@@ -648,6 +683,7 @@ class _BookmarkRow extends StatelessWidget {const _BookmarkRow({required this.itemId,required this.bookmark,+ this.displaySpeed = 1.0,required this.cs,required this.tt,required this.selecting,@@ -704,7 +740,7 @@ class _BookmarkRow extends StatelessWidget {),const SizedBox(width: 8),Text(- bookmark.formattedPosition,+ bookmark.formattedAt(displaySpeed),style: tt.labelSmall?.copyWith(color: cs.onSurfaceVariant,fontFeatures: [const FontFeature.tabularFigures()],diff --git a/lib/screens/car_mode_screen.dart b/lib/screens/car_mode_screen.dartindex 47623d81..8bf8b31e 100644--- a/lib/screens/car_mode_screen.dart+++ b/lib/screens/car_mode_screen.dart@@ -47,6 +47,7 @@ class _CarModeScreenState extends State<CarModeScreen>int _backSkip = 10;int _forwardSkip = 30;bool _preferChapterBar = false;+ bool _speedAdjustedTime = true;late AnimationController _playPauseController;Timer? _displayTimer;@@ -60,6 +61,9 @@ class _CarModeScreenState extends State<CarModeScreen>);_loadSkipSettings();PlayerSettings.settingsChanged.addListener(_loadSkipSettings);+ PlayerSettings.getSpeedAdjustedTime().then((v) {+ if (mounted && v != _speedAdjustedTime) setState(() => _speedAdjustedTime = v);+ });widget.player.addListener(_onPlayerChanged);// Tick every second so the speed-adjusted time display updates smoothly// even when the position stream fires less often (e.g. at 0.5x speed).@@ -163,7 +167,7 @@ class _CarModeScreenState extends State<CarModeScreen>final chapters = widget.player.chapters;if (chapters.isEmpty) return (0, Duration.zero, Duration.zero);final pos = widget.player.position.inSeconds.toDouble();- final speed = widget.player.speed;+ final speed = _speedAdjustedTime ? widget.player.speed : 1.0;for (final ch in chapters) {final start = (ch['start'] as num?)?.toDouble() ?? 0;final end = (ch['end'] as num?)?.toDouble() ?? 0;@@ -254,7 +258,7 @@ class _CarModeScreenState extends State<CarModeScreen>builder: (context, _) {final pos = player.position;final total = Duration(seconds: player.totalDuration.round());- final speed = player.speed;+ final speed = _speedAdjustedTime ? player.speed : 1.0;final bookProgress = total.inMilliseconds > 0? (pos.inMilliseconds / total.inMilliseconds).clamp(0.0, 1.0): 0.0;diff --git a/lib/services/bookmark_service.dart b/lib/services/bookmark_service.dartindex 88ba9e61..fa9a4117 100644--- a/lib/services/bookmark_service.dart+++ b/lib/services/bookmark_service.dart@@ -63,10 +63,16 @@ class Bookmark {);}- String get formattedPosition {+ String get formattedPosition => formattedAt(1.0);++ /// Position formatted for display at [speed] (stored seconds / speed), so+ /// lists can honor the speed-adjusted-time setting. The stored position and+ /// everything sent to the server stay raw book seconds.+ String formattedAt(double speed) {+ final div = speed > 0 ? speed : 1.0;// 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 p = positionSeconds < 0 ? 0.0 : positionSeconds / div;final h = p ~/ 3600;final m = (p % 3600) ~/ 60;final s = p.toInt() % 60;diff --git a/lib/widgets/book_detail_sheet.dart b/lib/widgets/book_detail_sheet.dartindex cce65745..62a20da8 100644--- a/lib/widgets/book_detail_sheet.dart+++ b/lib/widgets/book_detail_sheet.dart@@ -199,9 +199,17 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {bool _narratorsExpanded = false;bool _squareCovers = false;bool _isUpdatingProgressDate = false;+ bool _speedAdjustedTime = true;+ double _savedSpeed = 1.0;ColorScheme? _rawCoverScheme;String? _coverSchemeUrl; // URL the current scheme was derived from+ double get _displaySpeed {+ if (!_speedAdjustedTime) return 1.0;+ final player = AudioPlayerService();+ return player.currentItemId == widget.itemId ? player.speed : _savedSpeed;+ }+/// The cover-derived scheme, unless the user has chosen a manual app color/// and opted to use it everywhere - then book pages wear that color too.ColorScheme? get _coverScheme {@@ -227,6 +235,11 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {SocketService().addItemUpdatedListener(_onSocketItemUpdated);PlayerSettings.getRectangleCovers().then((v) { if (mounted) setState(() => _squareCovers = !v); });PlayerSettings.getShowGoodreadsButton().then((v) { if (mounted) setState(() => _showGoodreads = v); });+ PlayerSettings.getSpeedAdjustedTime().then((v) { if (mounted && v != _speedAdjustedTime) setState(() => _speedAdjustedTime = v); });+ PlayerSettings.getBookSpeed(widget.itemId).then((s) async {+ final speed = s ?? await PlayerSettings.getDefaultSpeed();+ if (mounted && speed != _savedSpeed) setState(() => _savedSpeed = speed);+ });ScopedPrefs.getStringList('saved_ebooks').then((list) {if (mounted && list.contains(widget.itemId)) {setState(() => _ebookSaved = true);@@ -948,7 +961,7 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {child: Row(children: [SizedBox(width: 28, child: Text('${e.key + 1}', style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.3)))),Expanded(child: Text(ch['title'] as String? ?? l.chapterNumber(e.key + 1), maxLines: 1, overflow: TextOverflow.ellipsis, style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.6)))),- Text(formatHm(((ch['end'] as num?)?.toDouble() ?? 0) - ((ch['start'] as num?)?.toDouble() ?? 0)), style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.3))),+ Text(formatHm((((ch['end'] as num?)?.toDouble() ?? 0) - ((ch['start'] as num?)?.toDouble() ?? 0)) / _displaySpeed), style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.3))),]));})]],if (_bookmarks.isNotEmpty) ...[const SizedBox(height: 16),@@ -961,7 +974,7 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {final hasNote = bm.note != null && bm.note!.isNotEmpty;return Padding(padding: const EdgeInsets.symmetric(vertical: 3),child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [- SizedBox(width: 56, child: Text(bm.formattedPosition, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.3)))),+ SizedBox(width: 56, child: Text(bm.formattedAt(_displaySpeed), style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.3)))),Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [Text(bm.title, maxLines: 1, overflow: TextOverflow.ellipsis, style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.6))),if (hasNote)diff --git a/lib/widgets/bookmark_detail_dialog.dart b/lib/widgets/bookmark_detail_dialog.dartindex f5e6362c..63692558 100644--- a/lib/widgets/bookmark_detail_dialog.dart+++ b/lib/widgets/bookmark_detail_dialog.dart@@ -6,6 +6,7 @@ import 'package:provider/provider.dart';import '../l10n/app_localizations.dart';import '../providers/library_provider.dart';import '../services/api_service.dart';+import '../services/audio_player_service.dart';import '../services/bookmark_service.dart';import '../services/bookmark_preview_player.dart';import '../services/download_service.dart';@@ -43,6 +44,9 @@ class _BookmarkDetailSheetState extends State<BookmarkDetailSheet> {late double _seconds;late final BookmarkPreviewPlayer _preview;bool _saving = false;+ // Display-only speed division (speed-adjusted-time setting). _seconds stays+ // raw book time throughout - preview, clip export, jump and save all use it.+ double _displaySpeed = 1.0;@overridevoid initState() {@@ -56,6 +60,19 @@ class _BookmarkDetailSheetState extends State<BookmarkDetailSheet> {itemId: widget.itemId, api: widget.api, label: 'bookmark')..clipLength = const Duration(seconds: 60)..addListener(_onPreview);+ _loadDisplaySpeed();+ }++ Future<void> _loadDisplaySpeed() async {+ if (!await PlayerSettings.getSpeedAdjustedTime()) return;+ final player = AudioPlayerService();+ final speed = player.currentItemId == widget.itemId+ ? player.speed+ : (await PlayerSettings.getBookSpeed(widget.itemId) ??+ await PlayerSettings.getDefaultSpeed());+ if (mounted && speed > 0 && speed != _displaySpeed) {+ setState(() => _displaySpeed = speed);+ }}void _onPreview() {@@ -227,7 +244,7 @@ class _BookmarkDetailSheetState extends State<BookmarkDetailSheet> {Text(l.editBookmark, style: tt.titleLarge),const Spacer(),Text(- _fmt(_seconds),+ _fmt(_seconds / _displaySpeed),style: tt.titleMedium?.copyWith(color: cs.primary,fontWeight: FontWeight.w600,@@ -257,12 +274,14 @@ class _BookmarkDetailSheetState extends State<BookmarkDetailSheet> {),const SizedBox(height: 16),Row(children: [- _nudgeBtn('-5', _saving ? null : () => _nudge(-5)),- _nudgeBtn('-1', _saving ? null : () => _nudge(-1)),+ // Nudges move the DISPLAYED time by the button amount, so the+ // raw delta is scaled up by the display speed.+ _nudgeBtn('-5', _saving ? null : () => _nudge(-5 * _displaySpeed)),+ _nudgeBtn('-1', _saving ? null : () => _nudge(-1 * _displaySpeed)),Expanded(child: Center(child: Text(- _fmt(_seconds),+ _fmt(_seconds / _displaySpeed),style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w600,fontFeatures: [const FontFeature.tabularFigures()],@@ -270,8 +289,8 @@ class _BookmarkDetailSheetState extends State<BookmarkDetailSheet> {),),),- _nudgeBtn('+1', _saving ? null : () => _nudge(1)),- _nudgeBtn('+5', _saving ? null : () => _nudge(5)),+ _nudgeBtn('+1', _saving ? null : () => _nudge(1 * _displaySpeed)),+ _nudgeBtn('+5', _saving ? null : () => _nudge(5 * _displaySpeed)),]),const SizedBox(height: 4),Center(diff --git a/lib/widgets/card_buttons.dart b/lib/widgets/card_buttons.dartindex 13efbf0b..c959828f 100644--- a/lib/widgets/card_buttons.dart+++ b/lib/widgets/card_buttons.dart@@ -758,7 +758,27 @@ class SimpleBookmarkSheet extends StatefulWidget {class _SimpleBookmarkSheetState extends State<SimpleBookmarkSheet> {List<Bookmark>? _bookmarks;String _sort = 'newest';- @override void initState() { super.initState(); _loadSort(); }+ bool _speedAdjustedTime = true;+ double _savedSpeed = 1.0;+ @override void initState() {+ super.initState();+ _loadSort();+ PlayerSettings.getSpeedAdjustedTime().then((v) {+ if (mounted && v != _speedAdjustedTime) setState(() => _speedAdjustedTime = v);+ });+ PlayerSettings.getBookSpeed(widget.itemId).then((s) async {+ final speed = s ?? await PlayerSettings.getDefaultSpeed();+ if (mounted && speed != _savedSpeed) setState(() => _savedSpeed = speed);+ });+ }++ double get _displaySpeed {+ if (!_speedAdjustedTime) return 1.0;+ if (_isCasting) return ChromecastService().castSpeed;+ return widget.player.currentItemId == widget.itemId+ ? widget.player.speed+ : _savedSpeed;+ }Future<void> _loadSort() async {_sort = await PlayerSettings.getBookmarkSort();// Show the local bookmarks first so the sheet never hangs on a slow or@@ -897,7 +917,7 @@ class _SimpleBookmarkSheetState extends State<SimpleBookmarkSheet> {Text(bm.title, maxLines: 1, overflow: TextOverflow.ellipsis,style: tt.bodyMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.7))),const SizedBox(height: 2),- Text(bm.formattedPosition, style: tt.labelSmall?.copyWith(color: cs.onSurfaceVariant)),+ Text(bm.formattedAt(_displaySpeed), style: tt.labelSmall?.copyWith(color: cs.onSurfaceVariant)),if (hasNote) ...[const SizedBox(height: 4),Container(@@ -944,7 +964,7 @@ class _SimpleBookmarkSheetState extends State<SimpleBookmarkSheet> {title: Text(l.deleteBookmarkQuestion),content: Text(l.bookmarksJumpShortContent(bookmark.title,- bookmark.formattedPosition,+ bookmark.formattedAt(_displaySpeed),)),actions: [TextButton(@@ -1002,12 +1022,13 @@ class _SimpleBookmarkSheetState extends State<SimpleBookmarkSheet> {final pos = _isCasting? cast.castPosition.inMilliseconds / 1000.0: widget.player.position.inMilliseconds / 1000.0;- final h = pos ~/ 3600; final m = (pos % 3600) ~/ 60; final s = pos.toInt() % 60;- final posStr = h > 0 ? '$h:${m.toString().padLeft(2, '0')}:${s.toString().padLeft(2, '0')}' : '$m:${s.toString().padLeft(2, '0')}';- // Find current chapter name for default title+ // Default title is the current chapter name, or a plain "Bookmark". No+ // timestamp in the title: the stored raw time would disagree with the+ // speed-adjusted display here, and an adjusted one would disagree with the+ // ABS web UI, which only knows raw times.final chapters = _isCasting ? cast.castingChapters : widget.player.chapters;- String defaultTitle = l.bookmarkAtPosition(posStr);+ String defaultTitle = l.bookmark;for (final ch in chapters) {final cm = ch as Map<String, dynamic>;final cs = (cm['start'] as num?)?.toDouble() ?? 0;@@ -2087,10 +2108,24 @@ class _PlaybackHistorySheetBodyState extends State<_PlaybackHistoryBody>late final TabController _tabController;late final Future<List<PlaybackEvent>> _localFuture;Future<List<Map<String, dynamic>>?>? _serverFuture;+ bool _speedAdjustedTime = true;+ double _savedSpeed = 1.0;++ double get _displaySpeed {+ if (!_speedAdjustedTime) return 1.0;+ return widget.isActive ? widget.player.speed : _savedSpeed;+ }@overridevoid initState() {super.initState();+ PlayerSettings.getSpeedAdjustedTime().then((v) {+ if (mounted && v != _speedAdjustedTime) setState(() => _speedAdjustedTime = v);+ });+ PlayerSettings.getBookSpeed(widget.itemId).then((s) async {+ final speed = s ?? await PlayerSettings.getDefaultSpeed();+ if (mounted && speed != _savedSpeed) setState(() => _savedSpeed = speed);+ });_selectedTab = widget.initialTab.index;_tabController = TabController(length: 2,@@ -2299,7 +2334,7 @@ class _PlaybackHistorySheetBodyState extends State<_PlaybackHistoryBody>lastDate = eventDate;items.add(_dateHeader(eventDate));}- final positionLabel = fmtTime(event.positionSeconds);+ final positionLabel = fmtTime(event.positionSeconds / _displaySpeed);final isAdvancedEvent =kAdvancedHistoryEvents.contains(event.type);items.add(ListTile(diff --git a/lib/widgets/card_progress_bar.dart b/lib/widgets/card_progress_bar.dartindex a15b38bf..1555ee70 100644--- a/lib/widgets/card_progress_bar.dart+++ b/lib/widgets/card_progress_bar.dart@@ -347,19 +347,19 @@ class _CardDualProgressBarState extends State<CardDualProgressBar> with WidgetsBPadding(padding: const EdgeInsets.only(top: 2, bottom: 6), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [- Text(_fmt(_bookDragValue != null ? _bookDragValue! * totalDur : bookElapsed), style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.7) : cs.onSurfaceVariant, fontSize: 12 * _progressTextScale, fontWeight: FontWeight.w600, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),+ Text(_fmt(_bookDragValue != null ? _bookDragValue! * totalDur / speedDiv : bookElapsed), style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.7) : cs.onSurfaceVariant, fontSize: 12 * _progressTextScale, fontWeight: FontWeight.w600, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),if (_bookDragValue != null && _bookScrubSpeed < 1.0) Text(_scrubSpeedLabel(l, _bookScrubSpeed), style: tt.labelSmall?.copyWith(color: widget.accent, fontSize: 11, fontWeight: FontWeight.w500)),- Text('-${_fmt(_bookDragValue != null ? (1.0 - _bookDragValue!) * totalDur : bookRemaining)}', style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.7) : cs.onSurfaceVariant, fontSize: 12 * _progressTextScale, fontWeight: FontWeight.w600, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),+ Text('-${_fmt(_bookDragValue != null ? (1.0 - _bookDragValue!) * totalDur / speedDiv : bookRemaining)}', style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.7) : cs.onSurfaceVariant, fontSize: 12 * _progressTextScale, fontWeight: FontWeight.w600, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),],)),] else ...[Row(children: [- Text(_fmt(_bookDragValue != null ? _bookDragValue! * totalDur : bookElapsed), style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.6) : cs.onSurface.withValues(alpha: 0.5), fontSize: 11 * _progressTextScale, fontWeight: FontWeight.w500, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),+ Text(_fmt(_bookDragValue != null ? _bookDragValue! * totalDur / speedDiv : bookElapsed), style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.6) : cs.onSurface.withValues(alpha: 0.5), fontSize: 11 * _progressTextScale, fontWeight: FontWeight.w500, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),const SizedBox(width: 8),Expanded(child: ClipRRect(borderRadius: BorderRadius.circular(4),child: LinearProgressIndicator(value: bookProgress, minHeight: 3, backgroundColor: cs.onSurface.withValues(alpha: 0.08), valueColor: AlwaysStoppedAnimation(widget.accent.withValues(alpha: 0.5))))),const SizedBox(width: 8),- Text('-${_fmt(_bookDragValue != null ? (1.0 - _bookDragValue!) * totalDur : bookRemaining)}', style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.6) : cs.onSurface.withValues(alpha: 0.5), fontSize: 11 * _progressTextScale, fontWeight: FontWeight.w500, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),+ Text('-${_fmt(_bookDragValue != null ? (1.0 - _bookDragValue!) * totalDur / speedDiv : bookRemaining)}', style: tt.labelSmall?.copyWith(color: _bookDragValue != null ? cs.onSurface.withValues(alpha: 0.6) : cs.onSurface.withValues(alpha: 0.5), fontSize: 11 * _progressTextScale, fontWeight: FontWeight.w500, shadows: [Shadow(color: Theme.of(context).brightness == Brightness.dark ? Colors.black.withValues(alpha: 0.5) : Colors.white.withValues(alpha: 0.5), blurRadius: 3)])),]),SizedBox(height: widget.compact ? 4 : 10),],