diff options
author | Scott Jackson <daneren2005@gmail.com> | 2018-01-10 17:34:28 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2018-01-10 17:34:28 -0800 |
commit | c04999f5859fe9d0569e77bcfaacc13af8439c42 (patch) | |
tree | a7670e4bf1c5e6ade599fbdbbad5b4befbb24c43 /app/src/main/java/github/daneren2005 | |
parent | 8ae4446fc1679486ecf80110984a69a416e1fdcf (diff) | |
download | dsub-c04999f5859fe9d0569e77bcfaacc13af8439c42.tar.gz dsub-c04999f5859fe9d0569e77bcfaacc13af8439c42.tar.bz2 dsub-c04999f5859fe9d0569e77bcfaacc13af8439c42.zip |
Tweak getRecentDownloads to take how many songs we have set to load into account
Diffstat (limited to 'app/src/main/java/github/daneren2005')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 3 |
1 files changed, 2 insertions, 1 deletions
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 e1b3d0ae..da9deac1 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -1038,7 +1038,8 @@ public class DownloadService extends Service { public synchronized List<DownloadFile> getRecentDownloads() { int from = Math.max(currentPlayingIndex - 10, 0); - int to = Math.min(currentPlayingIndex + 20, downloadList.size() - 1); + int songsToKeep = Math.max(Util.getPreloadCount(this), 20); + int to = Math.min(currentPlayingIndex + songsToKeep, downloadList.size() - 1); List<DownloadFile> temp = downloadList.subList(from, to); temp.addAll(backgroundDownloadList); return temp; |