From 5b2fadec0592b79001a941eef03f0a1f1a95b04d Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sun, 3 Aug 2008 21:10:05 +0200 Subject: - Add support for genre query. --- src/mp3_vnops.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/mp3_vnops.c b/src/mp3_vnops.c index 436be50..75f9ae1 100755 --- a/src/mp3_vnops.c +++ b/src/mp3_vnops.c @@ -26,13 +26,13 @@ static int mp3_getattr (const char *path, struct stat *stbuf) stbuf->st_nlink = 2; return 0; } - if (strcmp (path, "/Artists") == 0) { + if (strcmp(path, "/Artists") == 0 || + strcmp(path, "/Genres") == 0) { stbuf->st_mode = S_IFDIR | 0444; stbuf->st_nlink = 1; stbuf->st_size = 12; return 0; } - return -ENOENT; } @@ -58,22 +58,16 @@ static int mp3_readdir (const char *path, void *buf, fuse_fill_dir_t filler, * 2. Find the mp3s that matches the tags given from the path. * 3. Return the list of those mp3s. */ - DEBUG("Going to run query\n"); - if (!strcmp(path, "/Artists")) { + if (strcmp(path, "/Artists") == 0) { mp3_list("SELECT name FROM artist", 0, &fd); - /* List artists. */ + return (0); + } else if (strcmp(path, "/Genres") == 0) { + mp3_list("SELECT name FROM genre", 0, &fd); return (0); } return (-ENOENT); } - -void -call_lol(char *path) -{ - printf("Path %s\n", path); -} - static int mp3_open (const char *path, struct fuse_file_info *fi) { if (strcmp (path, "/Artists") == 0) -- cgit v1.2.3