fix deduping before input filtering
[spider.git] / perl / DXProt.pm
index 2027239b6bac792fffec04499124181f3ff4aaea..6c18a83052329dcddf29c42d149e38fd94d1e898 100644 (file)
@@ -441,11 +441,6 @@ sub normal
                                        return;
                                }
                        }
-                       
-                       if (Spot::dup($field[1], $field[2], $d, $field[5])) {
-                               dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr');
-                               return;
-                       }
 
 
                        my @spot = Spot::prepare($field[1], $field[2], $d, $field[5], $field[6], $field[7]);
@@ -458,6 +453,14 @@ sub normal
                                }
                        }
 
+                       # this goes after the input filtering, but before the add
+                       # so that if it is input filtered, it isn't added to the dup
+                       # list. This allows it to come in from a "legitimate" source
+                       if (Spot::dup($field[1], $field[2], $d, $field[5])) {
+                               dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr');
+                               return;
+                       }
+
                        # add it 
                        Spot::add(@spot);