X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/0126692cf18af76f6cede755f995cb28c44fb331..3effdc300f80c262546757e081448b0ba1e0cbed:/server/server.c diff --git a/server/server.c b/server/server.c index 44580c9..ea8c0ed 100644 --- a/server/server.c +++ b/server/server.c @@ -1,6 +1,6 @@ /* * 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 @@ -356,7 +356,7 @@ static int c_rescan(struct conn *c, 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 */ } @@ -995,9 +995,18 @@ static int c_nop(struct conn *c, 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);