Remove successful downloads from queue

This commit is contained in:
inorichi
2015-12-18 16:41:16 +01:00
parent c6dc5d344d
commit 6412ec1d9b
5 changed files with 13 additions and 22 deletions

View File

@@ -296,6 +296,10 @@ public class DownloadManager {
}
download.totalProgress = actualProgress;
download.setStatus(status);
// Delete successful downloads from queue after notifying
if (status == Download.DOWNLOADED) {
queue.remove(download);
}
}
// Return the page list from the chapter's directory if it exists, null otherwise

View File

@@ -42,14 +42,6 @@ public class DownloadQueue {
return queue;
}
public void clearSuccessfulDownloads() {
for (Download download : queue) {
if (download.getStatus() == Download.DOWNLOADED) {
remove(download);
}
}
}
public Observable<Download> getActiveDownloads() {
return Observable.from(queue)
.filter(download -> download.getStatus() == Download.DOWNLOADING);