diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-08-21 18:29:30 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-08-21 18:29:30 -0700 |
commit | 0a50adfa3b2d3118b53716bb39d2cf4cafe9de60 (patch) | |
tree | 4a382ace21f7e606076c571a8d092b7868036bed | |
parent | b245375b2a072d53ad76adc6fcccfe1e016de4e6 (diff) | |
download | dsub-0a50adfa3b2d3118b53716bb39d2cf4cafe9de60.tar.gz dsub-0a50adfa3b2d3118b53716bb39d2cf4cafe9de60.tar.bz2 dsub-0a50adfa3b2d3118b53716bb39d2cf4cafe9de60.zip |
Fixes to web commit for auto deleting bookmarks
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index b18928e1..5b489255 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -49,6 +49,7 @@ import github.daneren2005.dsub.util.SimpleServiceBinder; import github.daneren2005.dsub.util.SyncUtil; import github.daneren2005.dsub.util.Util; import github.daneren2005.dsub.util.compat.RemoteControlClientHelper; +import github.daneren2005.dsub.view.UpdateView; import github.daneren2005.serverproxy.BufferProxy; import java.io.File; @@ -556,7 +557,7 @@ public class DownloadService extends Service { lifecycleSupport.post(new Runnable() { @Override public void run() { - if(online) { + if (online) { checkDownloads(); } else { clearIncomplete(); @@ -1377,7 +1378,7 @@ public class DownloadService extends Service { mediaPlayer.setOnBufferingUpdateListener(new MediaPlayer.OnBufferingUpdateListener() { public void onBufferingUpdate(MediaPlayer mp, int percent) { Log.i(TAG, "Buffered " + percent + "%"); - if(percent == 100) { + if (percent == 100) { mediaPlayer.setOnBufferingUpdateListener(null); } } @@ -1506,7 +1507,7 @@ public class DownloadService extends Service { if(downloadFile.getSong() instanceof PodcastEpisode) { toDelete.add(downloadFile); } - clearCurrentBookmark(false); + clearCurrentBookmark(downloadFile.getSong(), false); } else { // If file is not completely downloaded, restart the playback from the current position. synchronized (DownloadService.this) { @@ -1786,15 +1787,14 @@ public class DownloadService extends Service { } private void clearCurrentBookmark() { - clearCurrentBookmark(true); - } - private void clearCurrentBookmark(boolean checkPosition) { // If current is null, nothing to do if(currentPlaying == null) { return; } - - final MusicDirectory.Entry entry = currentPlaying.getSong(); + + clearCurrentBookmark(currentPlaying.getSong(), true); + } + private void clearCurrentBookmark(final MusicDirectory.Entry entry, boolean checkPosition) { // If no bookmark, move on if(entry.getBookmark() == null) { return; @@ -1814,6 +1814,7 @@ public class DownloadService extends Service { if(found != null) { found.setBookmark(null); } + return null; } @Override |