diff --git a/src/main.c b/src/main.c index 2b431b38..0e48e036 100644 --- a/src/main.c +++ b/src/main.c @@ -463,6 +463,8 @@ int main(int argc, char *argv[]) { DPRINTF(E_LOG,L_MAIN,"Scanned %d songs in %d seconds\n",song_count, end_time-start_time); + config.reload = 1; /* force a reload on start */ + while(!config.stop) { if((conf_get_int("general","rescan_interval",0) && (rescan_counter > conf_get_int("general","rescan_interval",0)))) { diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index 7d6d68b4..d2e17bc0 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -397,6 +397,7 @@ int scan_static_playlist(char *path) { struct stat sb; char *current; char *perr; + char *ptr; DPRINTF(E_WARN,L_SCAN|L_PL,"Processing static playlist: %s\n",path); if(stat(path,&sb)) { @@ -404,7 +405,8 @@ int scan_static_playlist(char *path) { return FALSE; } - if((current=strrchr(path,PATHSEP)) == NULL) { + if(((current=strrchr(path,'/')) == NULL) && + ((current=strrchr(path,'\\')) == NULL)) { current = path; } else { current++; @@ -442,7 +444,14 @@ int scan_static_playlist(char *path) { } /* now get the *real* base_path */ strcpy(base_path,path); - if((current=strrchr(base_path,PATHSEP))) { + ptr = base_path; + while(*ptr) { + if((*ptr == '/') || (*ptr == '\\')) + *ptr = PATHSEP; + ptr++; + } + + if((current=strrchr(base_path,PATHSEP))){ *(current+1) = '\x0'; } /* else something is fubar */ @@ -459,6 +468,13 @@ int scan_static_playlist(char *path) { // FIXME - should chomp trailing comments + ptr = linebuffer; + while(*ptr) { + if((*ptr == '/') || (*ptr == '\\')) + *ptr = PATHSEP; + ptr++; + } + // otherwise, assume it is a path if((linebuffer[0] == PATHSEP) || (linebuffer[1] == ':')) { strcpy(file_path,linebuffer);