diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 11:07:39 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-08 11:07:39 +0200 |
commit | 7a023eb0b2d41ae0511c45449abada94df04dd7d (patch) | |
tree | fd328c0a988450abaefbc211cfbe1589e7ace5c4 | |
parent | 8a50e8a2663b5afd2fb3c80ea3424f3e68e14695 (diff) |
database: removed printDirectoryInfo()
The same can be achieved with directory_print(db_get_directory()).
-rw-r--r-- | src/command.c | 6 | ||||
-rw-r--r-- | src/database.c | 10 | ||||
-rw-r--r-- | src/database.h | 3 |
3 files changed, 5 insertions, 14 deletions
diff --git a/src/command.c b/src/command.c index 88fa04fbd..489761b52 100644 --- a/src/command.c +++ b/src/command.c @@ -574,16 +574,20 @@ static int handleLsInfo(struct client *client, int argc, char *argv[]) { const char *path = ""; + const struct directory *directory; if (argc == 2) path = argv[1]; - if (printDirectoryInfo(client, path) < 0) { + directory = getDirectory(path); + if (directory == NULL) { command_error(client, ACK_ERROR_NO_EXIST, "directory not found"); return -1; } + directory_print(client, directory); + if (isRootDirectory(path)) return lsPlaylists(client, path); diff --git a/src/database.c b/src/database.c index 75038839c..648d29c86 100644 --- a/src/database.c +++ b/src/database.c @@ -115,16 +115,6 @@ traverseAllIn(const char *name, data); } -int printDirectoryInfo(struct client *client, const char *name) -{ - struct directory *directory; - - if ((directory = getDirectory(name)) == NULL) - return -1; - - return directory_print(client, directory); -} - static char *getDbFile(void) { ConfigParam *param = parseConfigFilePath(CONF_DB_FILE, 1); diff --git a/src/database.h b/src/database.h index e8b3be997..03161683d 100644 --- a/src/database.h +++ b/src/database.h @@ -23,7 +23,6 @@ #include <sys/time.h> struct directory; -struct client; void directory_init(void); @@ -42,8 +41,6 @@ int traverseAllIn(const char *name, int (*forEachSong) (struct song *, void *), int (*forEachDir) (struct directory *, void *), void *data); -int printDirectoryInfo(struct client *client, const char *name); - int checkDirectoryDB(void); int writeDirectoryDB(void); |