Make playlist filenames honor filesystem case settings

This commit is contained in:
Ron Pedde 2006-08-20 05:02:09 +00:00
parent 53510607f1
commit 231017d571
1 changed files with 10 additions and 4 deletions

View File

@ -645,6 +645,7 @@ int db_sql_add_playlist(char **pe, char *name, int type, char *clause, char *pat
int result=DB_E_SUCCESS;
char *criteria;
char *estring;
char *correct_path;
result=db_sql_fetch_int(pe,&cnt,"select count(*) from playlists where "
"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_STATICFILE: /* static, from 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 "
"(title,type,items,query,db_timestamp,path,idx) "
"(title,type,items,query,db_timestamp,path,idx) "
"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;
case PL_SMART: /* smart */
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;
M3UFILE *pm3u=NULL;
SQL_ROW row;
char *proper_path;
proper_path = _db_proper_path(path);
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_NOROWS) {