Dereference library directories before processing

The filescanner dereferences symlinks as it encounters them, but it did
not dereference the top-level library directories given in the config.

Also the playlist scanner always dereferences the filenames.

As a result, there was a mismatch between the paths in the files table and
the paths in the playlistitems table if the library directory given in the
config contain a symlink somewhere along the way.
This commit is contained in:
Julien BLACHE 2010-01-24 10:54:52 +01:00
parent 022bebe1d9
commit f85fa927c8
1 changed files with 12 additions and 1 deletions

View File

@ -615,6 +615,7 @@ bulk_scan(void)
int nlib;
int ndirs;
char *path;
char *deref;
time_t start;
int i;
int j;
@ -634,7 +635,17 @@ bulk_scan(void)
{
path = cfg_getnstr(lib, "directories", j);
process_directories(i, path, F_SCAN_BULK);
deref = m_realpath(path);
if (!deref)
{
DPRINTF(E_LOG, L_SCAN, "Skipping library directory %s, could not dereference: %s\n", path, strerror(errno));
continue;
}
process_directories(i, deref, F_SCAN_BULK);
free(deref);
if (scan_exit)
return;