aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-10-22 16:10:09 -0700
committerScott Jackson <daneren2005@gmail.com>2014-10-22 16:10:09 -0700
commit6b6b3bcbcf47de353ff7ad3f82d6c6228a04c9d8 (patch)
tree80714e9175aa799e3125269efe3133b0c712687b
parent7c18c3464a158bb7b348688a32260ffd01016409 (diff)
downloaddsub-6b6b3bcbcf47de353ff7ad3f82d6c6228a04c9d8.tar.gz
dsub-6b6b3bcbcf47de353ff7ad3f82d6c6228a04c9d8.tar.bz2
dsub-6b6b3bcbcf47de353ff7ad3f82d6c6228a04c9d8.zip
#415 Don't auto delete bookmarks made with 10 seconds of current position
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index 08516cfd..8d9f6867 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -1890,7 +1890,18 @@ public class DownloadService extends Service {
}
private boolean isPastCutoff(int position, int duration) {
int cutoffPoint = (int) (duration * DELETE_CUTOFF);
- return duration > 0 && position > cutoffPoint;
+ boolean isPastCutoff = duration > 0 && position > cutoffPoint;
+
+ // Check to make sure song isn't within 10 seconds of where it was created
+ MusicDirectory.Entry entry = currentPlaying.getSong();
+ if(entry != null && entry.getBookmark() != null) {
+ Bookmark bookmark = entry.getBookmark();
+ if(position < (bookmark.getPosition() + 10000)) {
+ isPastCutoff = false;
+ }
+ }
+
+ return isPastCutoff;
}
private void clearCurrentBookmark() {