[db,jsonapi] case insensitive directory/file listing (#784)

* [db,jsonapi] case insensitive directory/file listing

* [jsonapi] file listing of playlist uses same VPATH ordering as per directory and files

* [db,jsonapi] sorting via existing S_VPATH

* [db] replace LOWER with COLLATE NOCASE
This commit is contained in:
whatdoineed2do 2019-08-21 21:54:34 +01:00 committed by ejurgensen
parent 9cb5810e9a
commit a5987addd4
2 changed files with 3 additions and 3 deletions

View File

@ -418,7 +418,7 @@ static const char *sort_clause[] =
"f.composer_sort",
"f.disc",
"f.track",
"f.virtual_path",
"f.virtual_path COLLATE NOCASE",
"pos",
"shuffle_pos",
};
@ -3890,7 +3890,7 @@ db_directory_id_bypath(const char *path)
int
db_directory_enum_start(struct directory_enum *de)
{
#define Q_TMPL "SELECT * FROM directories WHERE disabled = 0 AND parent_id = %d ORDER BY virtual_path;"
#define Q_TMPL "SELECT * FROM directories WHERE disabled = 0 AND parent_id = %d ORDER BY virtual_path COLLATE NOCASE;"
sqlite3_stmt *stmt;
char *query;
int ret;

View File

@ -3191,7 +3191,7 @@ jsonapi_reply_library_files(struct httpd_request *hreq)
goto error;
query_params.type = Q_PL;
query_params.sort = S_PLAYLIST;
query_params.sort = S_VPATH;
query_params.filter = db_mprintf("(f.directory_id = %d)", directory_id);
ret = fetch_playlists(&query_params, playlists_items, &total);