chiark / gitweb /
OSS support in speaker
[disorder] / server / rescan.c
index a2f26781386384568d730b3eef04738254dc546c..45f5a650178dd615b313d4acabce594f948050ae 100644 (file)
@@ -155,6 +155,8 @@ static void rescan_collection(const struct collection *c) {
     if(n < config->player.n) {
       nnew += !!trackdb_notice(track, path);
       ++ntracks;
+      if(ntracks % 1000 == 0)
+        info("rescanning %s, %ld tracks so far", c->root, ntracks);
     }
   }
   /* tidy up */
@@ -301,12 +303,17 @@ static void do_all(void (*fn)(const struct collection *c)) {
    */
 }
 
+/** @brief Expire noticed.db */
+static void expire_noticed(void) {
+  error(0, "expire_noticed not implemented yet TODO");
+}
+
 int main(int argc, char **argv) {
   int n;
   struct sigaction sa;
   
   set_progname(argv);
-  mem_init(1);
+  mem_init();
   if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
   while((n = getopt_long(argc, argv, "hVc:dD", options, 0)) >= 0) {
     switch(n) {
@@ -323,7 +330,7 @@ int main(int argc, char **argv) {
     openlog(progname, LOG_PID, LOG_DAEMON);
     log_default = &log_syslog;
   }
-  if(config_read()) fatal(0, "cannot read configuration");
+  if(config_read(0)) fatal(0, "cannot read configuration");
   xnice(config->nice_rescan);
   sa.sa_handler = signal_handler;
   sa.sa_flags = SA_RESTART;
@@ -338,6 +345,8 @@ int main(int argc, char **argv) {
     do_all(rescan_collection);
     /* Check that every track still exists */
     recheck_collection(0);
+    /* Expire noticed.db */
+    expire_noticed();
   }
   else {
     /* Rescan specified collections */