aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceImpl.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index abee1153..8b069217 100644
--- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -512,8 +512,10 @@ public class DownloadServiceImpl extends Service implements DownloadService {
public synchronized void clear(boolean serialize) {
// Delete podcast if fully listened to
if(currentPlaying != null && currentPlaying.getSong() instanceof PodcastEpisode) {
+ int duration = getPlayerDuration();
+
// Make sure > 95% of the way through
- int cutoffPoint = getPlayerDuration() * 0.95;
+ int cutoffPoint = (int)(duration * 0.95);
if(duration > 0 && cachedPosition > cutoffPoint) {
currentPlaying.delete();
}