From 3a71eece405c1ef624768fdcda0d06cc20c90ee8 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 4 Dec 2013 17:59:51 -0800 Subject: Fix podcast deleting --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); } -- cgit v1.2.3