From bbaf981c8e3de27186d1b68389903ae3ba4fc61f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 26 Aug 2010 21:57:37 +0200 Subject: Added title and album search. --- music.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'music.c') diff --git a/music.c b/music.c index 0f6656a..f788266 100644 --- a/music.c +++ b/music.c @@ -191,15 +191,27 @@ static GSList *music_find_rec(struct directory *directory, const gchar *name, en return list; } -GSList *music_find_artist(const gchar *_name) { +static GSList *music_find(const gchar *_name, enum tag_type type) { gchar *name = g_utf8_casefold(_name, strlen(_name)); - GSList *list = music_find_rec(music_root, name, TAG_TYPE_ARTIST); + GSList *list = music_find_rec(music_root, name, type); g_free(name); return list; } +GSList *music_find_artist(const gchar *name) { + return music_find(name, TAG_TYPE_ARTIST); +} + +GSList *music_find_title(const gchar *name) { + return music_find(name, TAG_TYPE_TITLE); +} + +GSList *music_find_album(const gchar *name) { + return music_find(name, TAG_TYPE_ALBUM); +} + gchar *music_get_full_path(const gchar *path) { return g_build_filename(music_root->path, path, NULL); } -- cgit v1.2.3