mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Follow the remove_empty_feeds option when using ignore_duplicate_articles
This commit is contained in:
parent
c35a81dafa
commit
ccbf0f50bd
@ -167,9 +167,10 @@ class BasicNewsRecipe(Recipe):
|
|||||||
extra_css = None
|
extra_css = None
|
||||||
|
|
||||||
#: If True empty feeds are removed from the output.
|
#: If True empty feeds are removed from the output.
|
||||||
#: This option has no effect if parse_index is overriden in
|
#: This option has no effect if parse_index is overridden in
|
||||||
#: the sub class. It is meant only for recipes that return a list
|
#: the sub class. It is meant only for recipes that return a list
|
||||||
#: of feeds using `feeds` or :meth:`get_feeds`.
|
#: of feeds using `feeds` or :meth:`get_feeds`. It is also used if you use
|
||||||
|
#: the ignore_duplicate_articles option.
|
||||||
remove_empty_feeds = False
|
remove_empty_feeds = False
|
||||||
|
|
||||||
#: List of regular expressions that determines which links to follow
|
#: List of regular expressions that determines which links to follow
|
||||||
@ -1047,6 +1048,10 @@ class BasicNewsRecipe(Recipe):
|
|||||||
article.title, feed.title))
|
article.title, feed.title))
|
||||||
feed.remove_article(article)
|
feed.remove_article(article)
|
||||||
|
|
||||||
|
if self.remove_empty_feeds:
|
||||||
|
feeds = [f for f in feeds if len(f) > 0]
|
||||||
|
return feeds
|
||||||
|
|
||||||
def build_index(self):
|
def build_index(self):
|
||||||
self.report_progress(0, _('Fetching feeds...'))
|
self.report_progress(0, _('Fetching feeds...'))
|
||||||
try:
|
try:
|
||||||
@ -1061,7 +1066,7 @@ class BasicNewsRecipe(Recipe):
|
|||||||
raise ValueError('No articles found, aborting')
|
raise ValueError('No articles found, aborting')
|
||||||
|
|
||||||
if self.ignore_duplicate_articles is not None:
|
if self.ignore_duplicate_articles is not None:
|
||||||
self.remove_duplicate_articles(feeds)
|
feeds = self.remove_duplicate_articles(feeds)
|
||||||
|
|
||||||
#feeds = FeedCollection(feeds)
|
#feeds = FeedCollection(feeds)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user