diff options
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 2 |
1 files changed, 1 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 7afdd73f..88c631f5 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -1073,7 +1073,7 @@ public class DownloadService extends Service { public synchronized List<DownloadFile> getRecentDownloads() { int from = Math.max(currentPlayingIndex - 10, 0); int songsToKeep = Math.max(Util.getPreloadCount(this), 20); - int to = Math.min(currentPlayingIndex + songsToKeep, downloadList.size() - 1); + int to = Math.min(currentPlayingIndex + songsToKeep, Math.max(downloadList.size() - 1, 0)); List<DownloadFile> temp = downloadList.subList(from, to); temp.addAll(backgroundDownloadList); return temp; |