/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
+ * Copyright (C) 2004-2008 Richard Kettlewell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
char attribute((unused)) **vec,
int attribute((unused)) nvec) {
info("S%x rescan by %s", c->tag, c->who);
- trackdb_rescan(c->ev);
+ trackdb_rescan(c->ev, 1/*check*/);
sink_writes(ev_writer_sink(c->w), "250 initiated rescan\n");
return 1; /* completed */
}
static int c_new(struct conn *c,
char **vec,
int nvec) {
- char **tracks = trackdb_new(0, nvec > 0 ? atoi(vec[0]) : INT_MAX);
+ int max, n;
+ char **tracks;
+ if(nvec > 0)
+ max = atoi(vec[0]);
+ else
+ max = INT_MAX;
+ if(max <= 0 || max > config->new_max)
+ max = config->new_max;
+ tracks = trackdb_new(0, max);
sink_printf(ev_writer_sink(c->w), "253 New track list follows\n");
+ n = 0;
while(*tracks) {
sink_printf(ev_writer_sink(c->w), "%s%s\n",
**tracks == '.' ? "." : "", *tracks);