From ada3681478995602d2d55d5fd61f2d93737e50f3 Mon Sep 17 00:00:00 2001
From: Alexandre Morignot <erdnaxeli@cervoi.se>
Date: Sun, 15 May 2016 15:17:47 +0200
Subject: [PATCH] fix global search without query

---
 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 f37d8c4..1d00e88 100644
--- a/PlayBot/utils/db/get.pm
+++ b/PlayBot/utils/db/get.pm
@@ -179,8 +179,8 @@ sub _prepare_request {
     else {
         if ($query->is_global) {
             $req = 'select p.id, p.sender, p.title, p.url, p.duration, p.external_id, p.type';
-            $req .= ' from playbot p';
-            $req .= ' where '.$words_sql.' and' if ($words_sql);
+            $req .= ' from playbot p where';
+            $req .= ' '.$words_sql.' and' if ($words_sql);
             $req .= ' p.playlist is false';
             $req .= ' group by p.id order by rand()';
 
-- 
GitLab