mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-19 20:14:18 -04:00
Make case-insensitive fs a little less broken
This commit is contained in:
parent
e878464716
commit
ad16949d12
12
src/db-sql.c
12
src/db-sql.c
@ -1915,6 +1915,7 @@ MP3FILE *db_sql_fetch_path(char **pe, char *path, int index) {
|
|||||||
MP3FILE *pmp3=NULL;
|
MP3FILE *pmp3=NULL;
|
||||||
int err;
|
int err;
|
||||||
char *query;
|
char *query;
|
||||||
|
char *proper_path;
|
||||||
|
|
||||||
/* if we are doing a full reload, then it can't be in here.
|
/* if we are doing a full reload, then it can't be in here.
|
||||||
* besides, we don't have an index anyway, so we don't want to
|
* besides, we don't have an index anyway, so we don't want to
|
||||||
@ -1924,13 +1925,12 @@ MP3FILE *db_sql_fetch_path(char **pe, char *path, int index) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* not very portable, but works for sqlite */
|
/* not very portable, but works for sqlite */
|
||||||
if(conf_get_int("scanning","case_sensitive",1)) {
|
proper_path = _db_proper_path(path);
|
||||||
query="select * from songs where path='%q' and idx=%d";
|
query="select * from songs where path='%q' and idx=%d";
|
||||||
} else {
|
|
||||||
query="select * from songs where path=upper('%q') and idx=%d";
|
err=db_sql_fetch_row(pe,&row,query,proper_path,index);
|
||||||
}
|
free(proper_path);
|
||||||
|
|
||||||
err=db_sql_fetch_row(pe,&row,query,path,index);
|
|
||||||
if(err != DB_E_SUCCESS) {
|
if(err != DB_E_SUCCESS) {
|
||||||
if(err == DB_E_NOROWS) { /* Override generic error */
|
if(err == DB_E_NOROWS) { /* Override generic error */
|
||||||
if(pe) { free(*pe); };
|
if(pe) { free(*pe); };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user