X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FSpot.pm;h=3bd74c4fdca77fa1c74baf9ac5a604c4aed415a6;hb=80c59c4d9c407fd5021e693cf4ed5d1192b12d6c;hp=3844e05508e4e77661b8ea3b70e6d9057e8c3929;hpb=dd9bf905904d67616b549091784863d3e34a97ed;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index 3844e055..3bd74c4f 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -361,23 +361,27 @@ sub dup $d = int ($d / 60); $d *= 60; + $by =~ s/-\d+$//g; + $freq = sprintf "%.1f", $freq; # normalise frequency $call = substr($call, 0, $maxcalllth) if length $call > $maxcalllth; chomp $text; $text =~ s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg; - $text = unpad($text); - $text = substr($text, 0, $duplth) if length $text > $duplth; + $text = uc unpad($text); + my ($prefix) = $text =~ /\b(\w{1,4})$/; + $text =~ s/\b\w{1,4}$// if $prefix && is_prefix($prefix); + $text = substr($text, 0, $duplth) if length $text > $duplth; $text = pack("C*", map {$_ & 127} unpack("C*", $text)); - $text =~ s/[^a-zA-Z0-9]//g; - my $ldupkey = "X$freq|$call|" . uc $text; - my $sdupkey = "X$freq|$call|$by"; + $text =~ s/[^\w]//g; + my $ldupkey = "X$freq|$call|$by|$text"; my $t = DXDupe::find($ldupkey); - return 1 if $t && $t - $main::systime > 0; - $t = DXDupe::find($sdupkey); - return 1 if $t && $t - $main::systime > 0; + return 1 if $t && $t - $main::systime > 0; DXDupe::add($ldupkey, $main::systime+$dupage); - DXDupe::add($sdupkey, $main::systime+$dupage); +# my $sdupkey = "X$freq|$call|$by"; +# $t = DXDupe::find($sdupkey); +# return 1 if $t && $t - $main::systime > 0; +# DXDupe::add($sdupkey, $main::systime+$dupage); return 0; }