Remove successful downloads from queue
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user