Check Auto Download preference on the feed before auto downloading

AutoDownlaoding previously assumed that the filters had been initialised, which is not necessarily the case now that users can disable "Include in Auto Downloads" before subscribing to a new feed.
This commit is contained in:
Thom Merrilin 2021-01-03 16:53:20 +00:00 committed by ByteHamster
parent 81ea42a2a4
commit 55f7adb106
1 changed files with 3 additions and 2 deletions

View File

@ -55,8 +55,9 @@ public class AutomaticDownloadAlgorithm {
candidates.addAll(queue); candidates.addAll(queue);
for (FeedItem newItem : newItems) { for (FeedItem newItem : newItems) {
FeedPreferences feedPrefs = newItem.getFeed().getPreferences(); FeedPreferences feedPrefs = newItem.getFeed().getPreferences();
FeedFilter feedFilter = feedPrefs.getFilter(); if (feedPrefs.getAutoDownload()
if (!candidates.contains(newItem) && feedFilter.shouldAutoDownload(newItem)) { && !candidates.contains(newItem)
&& feedPrefs.getFilter().shouldAutoDownload(newItem)) {
candidates.add(newItem); candidates.add(newItem);
} }
} }