mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-05-20 19:41:49 +02:00
Limit number of returned search results
This commit is contained in:
parent
e51b6ade9a
commit
0de1c52535
@ -74,7 +74,7 @@ def get_song_completions(input_string):
|
|||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
# Don't look, it burns...
|
# Don't look, it burns...
|
||||||
cur.execute(
|
cur.execute(
|
||||||
"SELECT Title || \" - \" || Artist AS Song, Id FROM songs WHERE Song LIKE REPLACE(REPLACE(REPLACE(REPLACE(UPPER('%"+input_string+"%'),'ö','Ö'),'ü','Ü'),'ä','Ä'),'ß','ẞ')")
|
"SELECT Title || \" - \" || Artist AS Song, Id FROM songs WHERE Song LIKE REPLACE(REPLACE(REPLACE(REPLACE(UPPER('%"+input_string+"%'),'ö','Ö'),'ü','Ü'),'ä','Ä'),'ß','ẞ') LIMIT 20")
|
||||||
return cur.fetchall()
|
return cur.fetchall()
|
||||||
|
|
||||||
def add_entry(name,song_id):
|
def add_entry(name,song_id):
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
$("#filter").keyup( function () {
|
$("#filter").keyup( function () {
|
||||||
var value = $(this).val().toLowerCase();
|
var value = $(this).val().toLowerCase();
|
||||||
//alert(value);
|
//alert(value);
|
||||||
if(value.length >= 3) {
|
if(value.length >= 1) {
|
||||||
$.getJSON("/api/songs/compl", { search: value }, function (data) {
|
$.getJSON("/api/songs/compl", { search: value }, function (data) {
|
||||||
var items = [];
|
var items = [];
|
||||||
$.each(data, function (key, val) {
|
$.each(data, function (key, val) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user