Skip to content
Extraits de code Groupes Projets
Valider 9cc8884b rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

if we insert a duplicate context tag, we don't set context = 0

parent 06f2e1d3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -32,12 +32,19 @@ sub addTag ...@@ -32,12 +32,19 @@ sub addTag
my $stopwords_en = getStopWords('en'); my $stopwords_en = getStopWords('en');
my $stopwords_fr = getStopWords('fr'); my $stopwords_fr = getStopWords('fr');
return if ($stopwords_en->{lc $tag} or $stopwords_fr->{lc $tag}); return if ($context and ($stopwords_en->{lc $tag} or $stopwords_fr->{lc $tag}));
my $sth = $dbh->prepare_cached('INSERT INTO playbot_tags (id, tag, context) my $sth;
if (!$context) {
$sth = $dbh->prepare_cached('INSERT INTO playbot_tags (id, tag, context)
VALUES (?, ?, ?) VALUES (?, ?, ?)
ON DUPLICATE KEY ON DUPLICATE KEY
UPDATE context = 0'); UPDATE context = 0');
} else {
$sth = $dbh->prepare_cached('INSERT INTO playbot_tags (id, tag, context)
VALUES (?, ?, ?)');
}
$log->error("Couldn't prepare querie; aborting") unless (defined $sth); $log->error("Couldn't prepare querie; aborting") unless (defined $sth);
$sth->execute($id, $tag, ($context) ? 1 : 0) $sth->execute($id, $tag, ($context) ? 1 : 0)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter