* Add ReadyNAS-specific flag file support.
This commit is contained in:
parent
28a7d7aedb
commit
3be66cf1ca
@ -1,5 +1,5 @@
|
||||
# port for HTTP (descriptions and SOAP) traffic
|
||||
port=5555
|
||||
port=8200
|
||||
|
||||
# set this to the directory you want scanned.
|
||||
# * if have multiple directories, you can have multiple media_dir= lines
|
||||
|
12
scanner.c
12
scanner.c
@ -720,7 +720,14 @@ ScanDirectory(const char * dir, const char * parent, enum media_types type)
|
||||
}
|
||||
|
||||
if( !parent )
|
||||
{
|
||||
startID = get_next_available_id("OBJECTS", BROWSEDIR_ID);
|
||||
#ifdef READYNAS
|
||||
FILE * flag = fopen("/ramfs/.upnp-av_scan", "w");
|
||||
if( flag )
|
||||
fclose(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i=0; i < n; i++) {
|
||||
sprintf(full_path, "%s/%s", dir, namelist[i]->d_name);
|
||||
@ -753,6 +760,11 @@ ScanDirectory(const char * dir, const char * parent, enum media_types type)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef READYNAS
|
||||
if( access("/ramfs/.rescan_done", F_OK) == 0 )
|
||||
system("/bin/sh /ramfs/.rescan_done");
|
||||
unlink("/ramfs/.upnp-av_scan");
|
||||
#endif
|
||||
DPRINTF(E_WARN, L_SCANNER, "Scanning %s finished (%llu files)!\n", dir, fileno);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user