aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-28 14:16:45 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-03-28 14:16:45 +0100
commitbb5a7e24baf072af366b013240cc9d63f997153c (patch)
tree495ac9e72fc0e1ad2f712560c5b2051231e21975 /pyaggr3g470r
parentUpdated translations. (diff)
downloadnewspipe-bb5a7e24baf072af366b013240cc9d63f997153c.tar.gz
newspipe-bb5a7e24baf072af366b013240cc9d63f997153c.tar.bz2
newspipe-bb5a7e24baf072af366b013240cc9d63f997153c.zip
Pairs of duplicates are sorted by retrieved date.
Diffstat (limited to 'pyaggr3g470r')
-rwxr-xr-xpyaggr3g470r/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyaggr3g470r/utils.py b/pyaggr3g470r/utils.py
index a7f8ad64..d1e4759b 100755
--- a/pyaggr3g470r/utils.py
+++ b/pyaggr3g470r/utils.py
@@ -312,7 +312,10 @@ def compare_documents(feed):
date1, date2 = pair[0].date, pair[1].date
if clear_string(pair[0].title) == clear_string(pair[1].title) and \
(date1 - date2) < timedelta(days = 1):
- duplicates.append(pair)
+ if pair[0].retrieved_date < pair[1].retrieved_date:
+ duplicates.append((pair[0], pair[1]))
+ else:
+ duplicates.append(((pair[1], pair[0]))
return duplicates
def search_feed(url):
bgstack15