Source:
<code>private void onPostPlayback(final Playable playable, boolean ended, boolean skipped, boolean playingNext) { PlaybackPreferences.clearCurrentlyPlayingTemporaryPlaybackSpeed(); if (playable == null) { Log.e(TAG, "Cannot do post-playback processing: media was null"); return; } Log.d(TAG, "onPostPlayback(): media=" + playable.getEpisodeTitle()); if (!(playable instanceof FeedMedia)) { Log.d(TAG, "Not doing post-playback processing: media not of type FeedMedia"); if (ended) { playable.onPlaybackCompleted(getApplicationContext()); } else { playable.onPlaybackPause(getApplicationContext()); } return; } FeedMedia media = (FeedMedia) playable; FeedItem item = media.getItem(); boolean smartMarkAsPlayed = media.hasAlmostEnded(); if (!ended && smartMarkAsPlayed) { Log.d(TAG, "smart mark as played"); } if (ended || smartMarkAsPlayed) { media.onPlaybackCompleted(getApplicationContext()); } else { media.onPlaybackPause(getApplicationContext()); } <START> if (playable.hasAutoSkippedEnding()) { <END> ended = true; } if (item != null) { if (ended || smartMarkAsPlayed || (skipped && !UserPreferences.shouldSkipKeepEpisode())) { DBWriter.markItemPlayed(item, FeedItem.PLAYED, ended); DBWriter.removeQueueItem(PlaybackService.this, ended, item); if (item.getFeed().getPreferences().getCurrentAutoDelete() && (!item.isTagged(FeedItem.TAG_FAVORITE) || !UserPreferences.shouldFavoriteKeepEpisode())) { DBWriter.deleteFeedMediaOfItem(PlaybackService.this, media.getId()); Log.d(TAG, "Episode Deleted"); } } } if (ended || skipped || playingNext) { DBWriter.addItemToPlaybackHistory(media); } }</code><technical_language>Hmm this adds a lot of code for a single use-case. checking position instead of adding Playable methods</technical_language>

Target:
private void onPostPlayback(final Playable playable, boolean ended, boolean skipped, boolean playingNext) { PlaybackPreferences.clearCurrentlyPlayingTemporaryPlaybackSpeed(); if (playable == null) { Log.e(TAG, "Cannot do post-playback processing: media was null"); return; } Log.d(TAG, "onPostPlayback(): media=" + playable.getEpisodeTitle()); if (!(playable instanceof FeedMedia)) { Log.d(TAG, "Not doing post-playback processing: media not of type FeedMedia"); if (ended) { playable.onPlaybackCompleted(getApplicationContext()); } else { playable.onPlaybackPause(getApplicationContext()); } return; } FeedMedia media = (FeedMedia) playable; FeedItem item = media.getItem(); boolean smartMarkAsPlayed = media.hasAlmostEnded(); if (!ended && smartMarkAsPlayed) { Log.d(TAG, "smart mark as played"); } if (ended || smartMarkAsPlayed) { media.onPlaybackCompleted(getApplicationContext()); } else { media.onPlaybackPause(getApplicationContext()); } if (autoSkippedFeedMediaId >= 0 && autoSkippedFeedMediaId == media.getId()) { ended = true; } if (item != null) { if (ended || smartMarkAsPlayed || (skipped && !UserPreferences.shouldSkipKeepEpisode())) { DBWriter.markItemPlayed(item, FeedItem.PLAYED, ended); DBWriter.removeQueueItem(PlaybackService.this, ended, item); if (item.getFeed().getPreferences().getCurrentAutoDelete() && (!item.isTagged(FeedItem.TAG_FAVORITE) || !UserPreferences.shouldFavoriteKeepEpisode())) { DBWriter.deleteFeedMediaOfItem(PlaybackService.this, media.getId()); Log.d(TAG, "Episode Deleted"); } } } if (ended || skipped || playingNext) { DBWriter.addItemToPlaybackHistory(media); } }