From 67d1299b15f96076e2eb6fe60eb4fd3188cb98dd Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sat, 30 Dec 2017 15:27:46 +0100 Subject: [PATCH] Consider duplicates cannot belong to the same website, should fix #100. --- flatisfy/filters/duplicates.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flatisfy/filters/duplicates.py b/flatisfy/filters/duplicates.py index 0b9ee4a..e1da485 100644 --- a/flatisfy/filters/duplicates.py +++ b/flatisfy/filters/duplicates.py @@ -190,6 +190,12 @@ def deep_detect(flats_list): if flat2["id"] in matching_flats[flat1["id"]]: continue + if flat1["id"].split("@")[-1] == flat2["id"].split("@")[-1]: + # If the two flats are from the same website, consider they + # cannot be duplicates. See + # https://framagit.org/phyks/Flatisfy/issues/100. + continue + n_common_items = 0 try: # They should have the same area, up to one unit