diff options
author | Ulf Lilleengen <lulf@carrot.studby.ntnu.no> | 2008-08-09 14:09:13 +0200 |
---|---|---|
committer | Ulf Lilleengen <lulf@carrot.studby.ntnu.no> | 2008-08-09 14:09:13 +0200 |
commit | e8793de12358e0f6f9239cd93cdf4e6f54a40702 (patch) | |
tree | c1320a16c690d25314b76b2cad8e7fee36571f10 /src/mp3_vnops.c | |
parent | a0c3d4edb2ed876361b1eaaa383a12104e8b3aa1 (diff) |
- Add /Albums as a directory entry in the root tree.
Diffstat (limited to 'src/mp3_vnops.c')
-rwxr-xr-x | src/mp3_vnops.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mp3_vnops.c b/src/mp3_vnops.c index 8a620bf..1b5c031 100755 --- a/src/mp3_vnops.c +++ b/src/mp3_vnops.c @@ -29,7 +29,8 @@ static int mp3_getattr (const char *path, struct stat *stbuf) } if (strcmp(path, "/Artists") == 0 || strcmp(path, "/Genres") == 0 || - strcmp(path, "/Tracks") == 0) { + strcmp(path, "/Tracks") == 0 || + strcmp(path, "/Albums") == 0) { stbuf->st_mode = S_IFDIR | 0444; stbuf->st_nlink = 1; stbuf->st_size = 12; @@ -71,6 +72,7 @@ static int mp3_readdir (const char *path, void *buf, fuse_fill_dir_t filler, filler(buf, "Artists", NULL, 0); filler(buf, "Genres", NULL, 0); filler(buf, "Tracks", NULL, 0); + filler(buf, "Albums", NULL, 0); return (0); } @@ -89,6 +91,10 @@ static int mp3_readdir (const char *path, void *buf, fuse_fill_dir_t filler, lh = mp3_list_start(0, &fd, "SELECT title FROM song"); mp3_list_finish(lh); return (0); + } else if (strcmp(path, "/Albums") == 0) { + lh = mp3_list_start(0, &fd, "SELECT DISTINCT album FROM song"); + mp3_list_finish(lh); + return (0); } return (-ENOENT); |