Make playlist filenames honor filesystem case settings
This commit is contained in:
parent
53510607f1
commit
231017d571
14
src/db-sql.c
14
src/db-sql.c
|
@ -645,6 +645,7 @@ int db_sql_add_playlist(char **pe, char *name, int type, char *clause, char *pat
|
||||||
int result=DB_E_SUCCESS;
|
int result=DB_E_SUCCESS;
|
||||||
char *criteria;
|
char *criteria;
|
||||||
char *estring;
|
char *estring;
|
||||||
|
char *correct_path;
|
||||||
|
|
||||||
result=db_sql_fetch_int(pe,&cnt,"select count(*) from playlists where "
|
result=db_sql_fetch_int(pe,&cnt,"select count(*) from playlists where "
|
||||||
"upper(title)=upper('%q')",name);
|
"upper(title)=upper('%q')",name);
|
||||||
|
@ -668,10 +669,12 @@ int db_sql_add_playlist(char **pe, char *name, int type, char *clause, char *pat
|
||||||
case PL_STATICWEB: /* static, maintained in web interface */
|
case PL_STATICWEB: /* static, maintained in web interface */
|
||||||
case PL_STATICFILE: /* static, from file */
|
case PL_STATICFILE: /* static, from file */
|
||||||
case PL_STATICXML: /* from iTunes XML file */
|
case PL_STATICXML: /* from iTunes XML file */
|
||||||
|
correct_path = _db_proper_path(path);
|
||||||
result = db_sql_exec_fn(pe,E_LOG,"insert into playlists "
|
result = db_sql_exec_fn(pe,E_LOG,"insert into playlists "
|
||||||
"(title,type,items,query,db_timestamp,path,idx) "
|
"(title,type,items,query,db_timestamp,path,idx) "
|
||||||
"values ('%q',%d,0,NULL,%d,'%q',%d)",
|
"values ('%q',%d,0,NULL,%d,'%q',%d)",
|
||||||
name,type,time(NULL),path,index);
|
name,type,time(NULL),correct_path,index);
|
||||||
|
free(correct_path);
|
||||||
break;
|
break;
|
||||||
case PL_SMART: /* smart */
|
case PL_SMART: /* smart */
|
||||||
if(!db_sql_parse_smart(&estring,&criteria,clause)) {
|
if(!db_sql_parse_smart(&estring,&criteria,clause)) {
|
||||||
|
@ -1831,10 +1834,13 @@ M3UFILE *db_sql_fetch_playlist(char **pe, char *path, int index) {
|
||||||
int result;
|
int result;
|
||||||
M3UFILE *pm3u=NULL;
|
M3UFILE *pm3u=NULL;
|
||||||
SQL_ROW row;
|
SQL_ROW row;
|
||||||
|
char *proper_path;
|
||||||
|
|
||||||
|
proper_path = _db_proper_path(path);
|
||||||
result = db_sql_fetch_row(pe, &row, "select * from playlists where "
|
result = db_sql_fetch_row(pe, &row, "select * from playlists where "
|
||||||
"path='%q' and idx=%d",path,index);
|
"path='%q' and idx=%d",proper_path,index);
|
||||||
|
|
||||||
|
free(proper_path);
|
||||||
|
|
||||||
if(result != DB_E_SUCCESS) {
|
if(result != DB_E_SUCCESS) {
|
||||||
if(result == DB_E_NOROWS) {
|
if(result == DB_E_NOROWS) {
|
||||||
|
|
Loading…
Reference in New Issue