diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-26 21:57:37 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-26 21:57:37 +0200 |
commit | bbaf981c8e3de27186d1b68389903ae3ba4fc61f (patch) | |
tree | dcd5d99a007ecdbd00c47fd76a9c0157900a10b9 | |
parent | 89217bfc20237a4de1011dd4396b892d5db30af0 (diff) |
Added title and album search.
-rw-r--r-- | music.c | 16 | ||||
-rw-r--r-- | music.h | 4 |
2 files changed, 17 insertions, 3 deletions
@@ -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); } @@ -27,7 +27,9 @@ gboolean music_scan_root(); struct directory *music_find_dir(const gchar *path); struct file *music_find_file(const gchar *path); void music_free(); -GSList *music_find_artist(const gchar *_name); +GSList *music_find_artist(const gchar *name); +GSList *music_find_title(const gchar *name); +GSList *music_find_album(const gchar *name); gchar *music_get_full_path(const gchar *path); #endif |