chiark / gitweb /
web support for noticed.db
[disorder] / lib / client.c
index 979e54ab9432b20c5c28d781ec05cb95babb74b0..d68d9d76a9ded92d3932cb762c7f4410a5db4d11 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2004, 2005, 2006 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2006, 2007 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
@@ -600,6 +600,22 @@ int disorder_tags(disorder_client *c,
   return disorder_simple_list(c, vecp, nvecp, "tags", (char *)0);
 }
 
+/** @brief Get recentl added tracks
+ * @param c Client
+ * @param vecp Where to store pointer to list
+ * @param nvecp Where to store count
+ * @param max Maximum tracks to fetch, or 0 for all available
+ * @return 0 on success, non-0 on error
+ */
+int disorder_new_tracks(disorder_client *c,
+                       char ***vecp, int *nvecp,
+                       int max) {
+  char limit[32];
+
+  sprintf(limit, "%d", max);
+  return disorder_simple_list(c, vecp, nvecp, "new", limit, (char *)0);
+}
+
 int disorder_set_global(disorder_client *c,
                        const char *key, const char *value) {
   return disorder_simple(c, 0, "set-global", key, value, (char *)0);