Merge pull request #3624 from ByteHamster/fix-download-order

Fix download order list
This commit is contained in:
H. Lehmann 2019-11-21 10:05:48 +01:00 committed by GitHub
commit f7dc2d6a7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 8 deletions

View File

@ -459,15 +459,12 @@ public class DownloadService extends Service {
Downloader downloader = downloaderFactory.create(request);
if (downloader != null) {
numberOfDownloads.incrementAndGet();
// smaller rss feeds before bigger media files
if (request.getFeedfileType() == Feed.FEEDFILETYPE_FEED) {
downloads.add(0, downloader);
} else {
if (isEnqueued(request, itemsEnqueued)) {
request.setMediaEnqueued(true);
}
downloads.add(downloader);
if (request.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA
&& isEnqueued(request, itemsEnqueued)) {
request.setMediaEnqueued(true);
}
downloads.add(downloader);
downloadExecutor.submit(downloader);
postDownloaders();