diff options
-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; |