diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-08-07 15:14:58 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-08-07 15:15:13 -0700 |
commit | 059eb5b736d154e01d2a35fd27ca157d7de51a7a (patch) | |
tree | 7faa5e4dfe0c6d90e48ce0ecc2897067db51e79a /binding/mediaplayer-manager.c | |
parent | 351642ef3d3f57273c7d6d3122235c6c7957162c (diff) |
binding: media: scan local users Media directory
Scan ~/Music in addition to the mounted physical media.
Bug-AGL: SPEC-810
Change-Id: Ieb76cedc841cf5ea9ae4c260872943b9763ddcb3
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/mediaplayer-manager.c')
-rw-r--r-- | binding/mediaplayer-manager.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/binding/mediaplayer-manager.c b/binding/mediaplayer-manager.c index 6265312..38e5cab 100644 --- a/binding/mediaplayer-manager.c +++ b/binding/mediaplayer-manager.c @@ -83,6 +83,30 @@ void DebugTraceSendMsg(int level, gchar* message) } +GList* media_local_scan(GList *list) +{ + gchar *path = g_strconcat(g_get_home_dir(), "/", "Music", NULL); + gchar *tmp = NULL; + GDir *dir; + + dir = g_dir_open(path, 0, NULL); + if (dir == NULL) + { + LOGE("Cannot open media path %s\n", path); + return list; + } + + while ((tmp = (gchar *) g_dir_read_name(dir)) != NULL) + { + list = g_list_append(list, g_strdup_printf("file://%s/%s", path, tmp)); + } + + g_free(path); + g_dir_close(dir); + + return list; +} + GList* media_lightmediascanner_scan(void) { sqlite3 *conn; |