database: removed printDirectoryInfo()

The same can be achieved with directory_print(db_get_directory()).
This commit is contained in:
Max Kellermann 2008-10-08 11:07:39 +02:00
parent 8a50e8a266
commit 7a023eb0b2
3 changed files with 5 additions and 14 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);