From eb49873afdebc1fc27bfbc7b15dfdc312a96a3de Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 10 Mar 2016 18:03:33 -0800 Subject: Fix cutoff calculation to not always do duration - 10 minutes (supposed to max out at duration - 10 minutes) --- app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index b5a44ec1..8ea7538b 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -2357,7 +2357,7 @@ public class DownloadService extends Service { } // Make cutoff a maximum of 10 minutes - int cutoffPoint = Math.min((int) (duration * DELETE_CUTOFF), 10 * 60 * 1000); + int cutoffPoint = Math.max((int) (duration * DELETE_CUTOFF), duration - 10 * 60 * 1000); boolean isPastCutoff = duration > 0 && position > cutoffPoint; // Check to make sure song isn't within 10 seconds of where it was created -- cgit v1.2.3