Matthias Nott
2026-03-24 d17b6376e8137447c244693853fd05b57aaf368f
lib/services/audio_service.dart
....@@ -167,13 +167,20 @@
167167 if (path == null) return;
168168
169169 if (_isPlaying) {
170
- // Already playing — just add to queue, it will play when current finishes
170
+ // Already playing — add to queue, plays when current finishes
171171 _queue.add(path);
172
+ debugPrint('AudioService: queued (queue size: ${_queue.length})');
172173 } else {
173174 // Nothing playing — start immediately
174
- await _player.play(DeviceFileSource(path));
175
- _isPlaying = true;
176
- onPlaybackStateChanged?.call();
175
+ try {
176
+ await _player.play(DeviceFileSource(path));
177
+ _isPlaying = true;
178
+ onPlaybackStateChanged?.call();
179
+ debugPrint('AudioService: playing immediately');
180
+ } catch (e) {
181
+ debugPrint('AudioService: play failed: $e');
182
+ _onTrackComplete();
183
+ }
177184 }
178185 }
179186