From 1d319928425ca7646e0cbc596a94488b914e1529 Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Wed, 20 Jul 2022 18:39:12 +0000 Subject: [PATCH] Update slixfeed.py --- slixfeed.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slixfeed.py b/slixfeed.py index f4e199b..84dad65 100644 --- a/slixfeed.py +++ b/slixfeed.py @@ -705,6 +705,8 @@ def search_entries(conn, query): :param query: string :return: rows (string) """ + if len(query) < 2: + return "Please enter at least 2 characters to search" cur = conn.cursor() sql = "SELECT title, link FROM entries WHERE title LIKE '%{}%' LIMIT 50".format(query) # sql = "SELECT title, link FROM entries WHERE title OR link LIKE '%{}%'".format(query) @@ -719,7 +721,7 @@ def search_entries(conn, query): if counter: return results_list + "\n Total of {} results".format(counter) else: - return "No results found for: {}.".format(query) + return "No results found for: {}".format(query) def check_entry(conn, title, link): """