chiark / gitweb /
Implement most of the playlist commands in the server. playlist-set
[disorder] / lib / configuration.c
index 241d101dc30efa6d131866802777656dcff5177f..934e52b698535fd039d86082376a4dbf048836d4 100644 (file)
@@ -952,6 +952,8 @@ static const struct conf conf[] = {
   { C(noticed_history),  &type_integer,          validate_positive },
   { C(password),         &type_string,           validate_any },
   { C(player),           &type_stringlist_accum, validate_player },
+  { C(playlist_lock_timeout), &type_integer,     validate_positive },
+  { C(playlist_max) ,    &type_integer,          validate_positive },
   { C(plugins),          &type_string_accum,     validate_isdir },
   { C(prefsync),         &type_integer,          validate_positive },
   { C(queue_pad),        &type_integer,          validate_positive },
@@ -1198,6 +1200,8 @@ static struct config *config_default(void) {
   c->reminder_interval = 600;          /* 10m */
   c->new_bias_age = 7 * 86400;         /* 1 week */
   c->new_bias = 9000000;               /* 100 times the base weight */
+  c->playlist_max = INT_MAX;            /* effectively no limit */
+  c->playlist_lock_timeout = 10;        /* 10s */
   /* Default stopwords */
   if(config_set(&cs, (int)NDEFAULT_STOPWORDS, (char **)default_stopwords))
     exit(1);
@@ -1213,7 +1217,7 @@ static struct config *config_default(void) {
   return c;
 }
 
-static char *get_file(struct config *c, const char *name) {
+char *config_get_file2(struct config *c, const char *name) {
   char *s;
 
   byte_xasprintf(&s, "%s/%s", c->home, name);
@@ -1411,7 +1415,7 @@ char *config_usersysconf(const struct passwd *pw) {
 }
 
 char *config_get_file(const char *name) {
-  return get_file(config, name);
+  return config_get_file2(config, name);
 }
 
 /*