summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Lilleengen <lulf@nobby.studby.ntnu.no>2008-08-03 21:10:05 +0200
committerUlf Lilleengen <lulf@nobby.studby.ntnu.no>2008-08-03 21:10:05 +0200
commit5b2fadec0592b79001a941eef03f0a1f1a95b04d (patch)
treea9ca1e7a83a7c915731b799dc7fd2caf96420715
parent1304f27adbc3c4dd3b34f0a91b8ccb02c8d66c01 (diff)
- Add support for genre query.
-rwxr-xr-xsrc/mp3_vnops.c18
1 files 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)