mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
[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:
parent
9cb5810e9a
commit
a5987addd4
4
src/db.c
4
src/db.c
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user