A cross platform Audiobookshelf client for Android and iOS
Dart
Add alpha debug logging, bump 1.8.61 (build 79)
Nathan Poulson07840e126675
diff --git a/lib/services/audio_player_service.dart b/lib/services/audio_player_service.dartindex b3431555..ee9726f1 100644--- a/lib/services/audio_player_service.dart+++ b/lib/services/audio_player_service.dart@@ -1156,6 +1156,7 @@ class AudioPlayerService extends ChangeNotifier {static Future<void> onAppForegrounded() async {final service = _instance;if (!service.hasBook) return;+ debugPrint('[MediaSession] Foregrounded - refreshing (playing=${service.isPlaying}, session=${service._playbackSessionId != null}, item=${service._currentItemId})');// Re-activate audio session to get a fresh system tokenif (!_audioFocusDisabled) {try { (await AudioSession.instance).setActive(true); } catch (_) {}@@ -1175,6 +1176,7 @@ class AudioPlayerService extends ChangeNotifier {service._totalDuration,chapter: chapterTitle,);+ debugPrint('[MediaSession] Re-pushed media item and playback state');}}@@ -2505,7 +2507,9 @@ class AudioPlayerService extends ChangeNotifier {if (_playbackSessionId == null && _api != null && _currentItemId != null) {final prefs = await SharedPreferences.getInstance();final manualOffline = prefs.getBool('manual_offline_mode') ?? false;- if (!manualOffline && !_isOfflineMode) {+ if (manualOffline || _isOfflineMode) {+ debugPrint('[Player] Skipping session re-create on resume (manualOffline=$manualOffline, isOffline=$_isOfflineMode)');+ } else {try {final sessionData = _currentEpisodeId != null? await _api!.startEpisodePlaybackSession(_currentItemId!, _currentEpisodeId!)diff --git a/lib/services/progress_sync_service.dart b/lib/services/progress_sync_service.dartindex 054ad974..dfd57d68 100644--- a/lib/services/progress_sync_service.dart+++ b/lib/services/progress_sync_service.dart@@ -80,6 +80,7 @@ class ProgressSyncService {}) async {final pendingList = await ScopedPrefs.getStringList('pending_syncs');if (pendingList.contains(itemId)) {+ debugPrint('[Sync] Skipping server cache for $itemId - pending local sync would be clobbered (isFinished=$isFinished)');return;}final data = {@@ -269,7 +270,10 @@ class ProgressSyncService {debugPrint('[Sync] Flushed $itemId via progress update: ${localTime}s');// Decay backoff on success instead of resetting - avoids// hammering when the server is intermittently reachable- if (_consecutiveFailures > 0) _consecutiveFailures--;+ if (_consecutiveFailures > 0) {+ _consecutiveFailures--;+ debugPrint('[Sync] Backoff decayed to $_consecutiveFailures');+ }final updated = await ScopedPrefs.getStringList('pending_syncs');updated.remove(itemId);@@ -335,6 +339,7 @@ class ProgressSyncService {final key = 'offline_listening_$itemId';final existing = await ScopedPrefs.getInt(key) ?? 0;await ScopedPrefs.setInt(key, existing + seconds);+ debugPrint('[Sync] Offline listening +${seconds}s for $itemId (total=${existing + seconds}s)');// Track which items have pending offline timefinal pending = await ScopedPrefs.getStringList('pending_offline_listening');diff --git a/pubspec.yaml b/pubspec.yamlindex d4a9ab74..8d83e75a 100644--- a/pubspec.yaml+++ b/pubspec.yaml@@ -1,7 +1,7 @@name: absorbdescription: An Audiobookshelf Clientpublish_to: 'none'-version: 1.8.60+78+version: 1.8.61+79# v1.8.41: JWT auth (accessToken + refreshToken), MANAGE_EXTERNAL_STORAGE removed from playstore flavor# Build scripts (run from Git Bash):# . ./build_bundle.sh - Play Store AAB (no MANAGE_EXTERNAL_STORAGE)