diff options
-rw-r--r-- | music.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -82,8 +82,16 @@ static struct directory *music_find_dir_rec(struct directory *root, const gchar if(g_strcmp0(root->path, path) == 0) return root; - /* TODO: implement this */ - g_error("not implemented"); + for(struct directory *d = root->sub; d; d = d->next) { + if(g_strcmp0(d->path, path) == 0) { + return d; + } + + struct directory *temp = music_find_dir_rec(d, path); + if(temp) { + return temp; + } + } return NULL; } |