add scanning/skip_appledouble and scanning/ignore_dotfiles to close #82

This commit is contained in:
Ron Pedde 2006-04-27 07:15:05 +00:00
parent eba07e1e15
commit e3ba86f03a
1 changed files with 21 additions and 2 deletions

View File

@ -357,8 +357,14 @@ int scan_path(char *path) {
DPRINTF(E_WARN,L_SCAN,"Error statting: %s\n",strerror(errno));
} else {
if(sb.st_mode & S_IFDIR) { /* dir -- recurse */
DPRINTF(E_DBG,L_SCAN,"Found dir %s... recursing\n",pde->d_name);
if(conf_get_int("general","ignore_appledouble",1) &&
((strcasecmp(pde->d_name,".AppleDouble") == 0) ||
(strcasecmp(pde->d_name,".AppleDesktop") == 0))) {
DPRINTF(E_DBG,L_SCAN,"Skipping appledouble folder\n");
} else {
DPRINTF(E_DBG,L_SCAN,"Found %s.. recursing\n",pde->d_name);
scan_path(mp3_path);
}
} else {
scan_filename(mp3_path, is_compdir, extensions);
}
@ -516,6 +522,19 @@ void scan_filename(char *path, int compdir, char *extensions) {
fname++;
}
if(conf_get_int("scanning","ignore_dotfiles",0)) {
if(fname[0] == '.')
return;
if(strncmp(fname,":2e",3) == 0)
return;
}
if(conf_get_int("scanning","ignore_appledouble",1)) {
if(strncmp(fname,"._",2) == 0)
return;
}
if(stat(mp3_path,&sb)) {
DPRINTF(E_WARN,L_SCAN,"Error statting: %s\n",strerror(errno));
} else {