A cross platform Audiobookshelf client for Android and iOS
Dart
Reduce [Battery] log noise: remove tick logs and per-widget lifecycle spam
Nathan Poulson49c0800d2ca0
diff --git a/lib/services/audio_player_service.dart b/lib/services/audio_player_service.dartindex ebd2d54f..6610a46b 100644--- a/lib/services/audio_player_service.dart+++ b/lib/services/audio_player_service.dart@@ -1718,10 +1718,9 @@ class AudioPlayerService extends ChangeNotifier {void _updateWakeLock(bool playing) {if (PlayerSettings.keepScreenAwake && playing) {- debugPrint('[Battery] WakeLock ENABLED (playing=$playing, keepScreenAwake=true)');+ debugPrint('[Battery] WakeLock ENABLED');WakelockPlus.enable();} else {- debugPrint('[Battery] WakeLock DISABLED (playing=$playing, keepScreenAwake=${PlayerSettings.keepScreenAwake})');WakelockPlus.disable();}}@@ -1871,7 +1870,7 @@ class AudioPlayerService extends ChangeNotifier {// listener saves every 5s; this only matters when that stream goes silent.debugPrint('[Battery] bgSaveTimer STARTED (30s interval)');_bgSaveTimer = Timer.periodic(const Duration(seconds: 30), (_) async {- debugPrint('[Battery] bgSaveTimer TICK (playing=${_player?.playing}, item=$_currentItemId)');+ // [Battery] bgSaveTimer TICK - removed to reduce log noiseif (_currentItemId == null || _player == null || !_player!.playing) return;final pos = position;final posSec = pos.inMilliseconds / 1000.0;@@ -2316,7 +2315,7 @@ class AudioPlayerService extends ChangeNotifier {debugPrint('[Battery] bgSaveTimer RESTARTED (play)');_bgSaveTimer?.cancel();_bgSaveTimer = Timer.periodic(const Duration(seconds: 30), (_) async {- debugPrint('[Battery] bgSaveTimer TICK (playing=${_player?.playing}, item=$_currentItemId)');+ // [Battery] bgSaveTimer TICK - removed to reduce log noiseif (_currentItemId == null || _player == null || !_player!.playing) return;final pos = position;final posSec = pos.inMilliseconds / 1000.0;diff --git a/lib/services/home_widget_service.dart b/lib/services/home_widget_service.dartindex 402800ef..2c79b092 100644--- a/lib/services/home_widget_service.dart+++ b/lib/services/home_widget_service.dart@@ -297,7 +297,7 @@ class HomeWidgetService {if (_progressTimer?.isActive == true) return;debugPrint('[Battery] HomeWidget progressTimer STARTED (60s interval)');_progressTimer = Timer.periodic(const Duration(seconds: 60), (_) {- debugPrint('[Battery] HomeWidget progressTimer TICK');+ // [Battery] HomeWidget TICK - removed to reduce log noise_scheduleUpdate();});}diff --git a/lib/widgets/card_edge_progress_bar.dart b/lib/widgets/card_edge_progress_bar.dartindex 4a2d0c47..6f9af422 100644--- a/lib/widgets/card_edge_progress_bar.dart+++ b/lib/widgets/card_edge_progress_bar.dart@@ -101,12 +101,10 @@ class _CardEdgeProgressBarState extends State<CardEdgeProgressBar>@overridevoid didChangeAppLifecycleState(AppLifecycleState state) {if (state == AppLifecycleState.resumed) {- debugPrint('[Battery] CardEdgeProgressBar RESUMED');_backgrounded = false;_loadSettings();_syncTicker();} else if (state == AppLifecycleState.paused) {- debugPrint('[Battery] CardEdgeProgressBar PAUSED - stopping ticker');_backgrounded = true;_smoothTicker?.cancel();_smoothTicker = null;diff --git a/lib/widgets/card_progress_bar.dart b/lib/widgets/card_progress_bar.dartindex bb52c9eb..5ab4514f 100644--- a/lib/widgets/card_progress_bar.dart+++ b/lib/widgets/card_progress_bar.dart@@ -72,12 +72,10 @@ class _CardDualProgressBarState extends State<CardDualProgressBar> with WidgetsB@overridevoid didChangeAppLifecycleState(AppLifecycleState state) {if (state == AppLifecycleState.resumed) {- debugPrint('[Battery] CardDualProgressBar RESUMED');_backgrounded = false;_loadSettings();_syncTicker();} else if (state == AppLifecycleState.paused) {- debugPrint('[Battery] CardDualProgressBar PAUSED - stopping ticker');_backgrounded = true;_smoothTicker?.cancel();_smoothTicker = null;