From a890536601b062024f43c8f80c97df32790d2d6e Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 7 Nov 2021 18:26:07 +0100 Subject: [PATCH] morss: comment code a bit --- morss/morss.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/morss/morss.py b/morss/morss.py index b34dabf..aebf9ba 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -324,7 +324,7 @@ def FeedGather(rss, url, options): max_time = 0 if options.newest: - # :newest take the newest items + # :newest take the newest items (instead of appearing order) now = datetime.now(tz.tzutc()) sorted_items = sorted(rss.items, key=lambda x:x.updated or x.time or now, reverse=True) @@ -333,6 +333,7 @@ def FeedGather(rss, url, options): sorted_items = list(rss.items) for i, item in enumerate(sorted_items): + # hard cap if time.time() - start_time > lim_time >= 0 or i + 1 > lim_item >= 0: log('dropped') item.remove() @@ -345,6 +346,7 @@ def FeedGather(rss, url, options): item = ItemFix(item, options, url) + # soft cap if time.time() - start_time > max_time >= 0 or i + 1 > max_item >= 0: if not options.proxy: if ItemFill(item, options, url, True) is False: