From 0de46dd496db908215c1029e840f13457ff51e86 Mon Sep 17 00:00:00 2001
From: Alexandre Morignot <erdnaxeli@cervoi.se>
Date: Thu, 31 Mar 2016 22:53:49 +0200
Subject: [PATCH] Fix "!get -a"

---
 PlayBot/utils/db/get.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PlayBot/utils/db/get.pm b/PlayBot/utils/db/get.pm
index e73c254..a0ceb9d 100644
--- a/PlayBot/utils/db/get.pm
+++ b/PlayBot/utils/db/get.pm
@@ -169,8 +169,8 @@ sub _prepare_request {
         if ($query->is_global) {
             $req = 'select p.id, p.sender, p.title, p.url, p.duration';
             $req .= ' from playbot p';
-            $req .= ' where '.$words_sql if ($words_sql);
-            $req .= ' and p.playlist is false';
+            $req .= ' where '.$words_sql.' and' if ($words_sql);
+            $req .= ' p.playlist is false';
             $req .= ' group by p.id order by rand()';
 
             @args = (@words_param);
-- 
GitLab