diff --git a/minidlna.conf b/minidlna.conf index 279933e..eb2d0bf 100644 --- a/minidlna.conf +++ b/minidlna.conf @@ -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 diff --git a/scanner.c b/scanner.c index 3df493f..82ec02a 100644 --- a/scanner.c +++ b/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); } }