Skip to content

Commit

Permalink
Fix Sleep Timer end of episode when skip last is set (#3582)
Browse files Browse the repository at this point in the history
  • Loading branch information
mebarbosa authored Feb 12, 2025
1 parent a68acd9 commit b7cfb8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
([#3460](https://github.com/Automattic/pocket-casts-android/pull/3460))
* Fix issue with playback stopping when using Pixel Buds actions.
([#3493](https://github.com/Automattic/pocket-casts-android/pull/3493))
* Fix issue with sleep timer end of episode when has skip last set
([#3582](https://github.com/Automattic/pocket-casts-android/pull/3582))
* Updates
* Remove audio and video clip sharing
([#3481](https://github.com/Automattic/pocket-casts-android/pull/3481))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1458,8 +1458,8 @@ open class PlaybackManager @Inject constructor(
val podcast = playbackStateRelay.blockingFirst().podcast
if (podcast != null && podcast.skipLastSecs > 0) {
pause(sourceView = SourceView.AUTO_PAUSE)
onPlayerPaused()
}
onPlayerPaused()

// jump back 5 seconds from the current time so when the player opens it doesn't complete before giving the user a chance to skip back
player?.let {
Expand Down Expand Up @@ -2206,6 +2206,7 @@ open class PlaybackManager @Inject constructor(
if (timeRemaining < skipLast) {
if (isSleepAfterEpisodeEnabled()) {
sleepEndOfEpisode(episode)
episodeManager.markAsPlayedBlocking(episode, this, podcastManager)
} else {
statsManager.addTimeSavedAutoSkipping(timeRemaining.toLong() * 1000L)
episodeManager.markAsPlayedBlocking(episode, this, podcastManager)
Expand Down

0 comments on commit b7cfb8a

Please sign in to comment.