summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorTony Tam <149837+tonytamsf@users.noreply.github.com>2023-11-11 01:55:01 -0800
committerGitHub <noreply@github.com>2023-11-11 10:55:01 +0100
commit7bfb53cc001dcb98a40a3fe327b9d53b4a60a144 (patch)
tree336527a4f54354c9270481792786534ecb41b428 /core/src
parent8af06a9f25b8b0cc64f7b3667ecd361cd00b179a (diff)
downloadAntennaPod-7bfb53cc001dcb98a40a3fe327b9d53b4a60a144.zip
Fix sometimes stopping at the end of each episode (#6753)
The bug is on this line [#145](https://github.com/AntennaPod/AntennaPod/blob/f7a13065a9c92ba26d3686aeb18269f2313bd0b6/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java#L145) - the call to `PlaybackPreferences.getCurrentlyPlayingFeedMediaId()` returns the episode that was playing and deleted, hence it stops playing the next episode like it is supposed to. Because it's called in a Thread, the next episode already started playing for 1 second or so and then stops The fix will now save into the preference the correct episode that is playing on the PREPARE stage.
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
index c41ec93b1..5c8dead81 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
@@ -799,6 +799,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
updateNotificationAndMediaSession(newInfo.playable);
break;
case PREPARED:
+ if (mediaPlayer.getPSMPInfo().playable != null) {
+ PlaybackPreferences.writeMediaPlaying(mediaPlayer.getPSMPInfo().playable,
+ mediaPlayer.getPSMPInfo().playerStatus);
+ }
taskManager.startChapterLoader(newInfo.playable);
break;
case PAUSED: