From 329330f7b18b1d88236a234bb15cef22529aef02 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 23 May 2015 13:03:20 -0700 Subject: #511 Cap isPastCutoff to a max of 10 minutes (for very large podcasts) --- app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 3 ++- 1 file changed, 2 insertions(+), 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 c0268933..9e57f5b0 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -2104,7 +2104,8 @@ public class DownloadService extends Service { return false; } - int cutoffPoint = (int) (duration * DELETE_CUTOFF); + // Make cutoff a maximum of 10 minutes + int cutoffPoint = Math.min((int) (duration * DELETE_CUTOFF), 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