From 34aeacdb140533e04e2d6d9512bc25c342135dc7 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Thu, 2 Nov 2017 20:11:38 -0700 Subject: binding: mediascanner: remove superfluous local scan function Now lightmediascannerd scan the local ~/Music directory which has the plus of getting the metadata Bug-AGL: SPEC-1029 Change-Id: Iad13d343b8bd40cec803527b31763642bd141ded Signed-off-by: Matt Ranostay --- binding/media-api.c | 1 - binding/media-manager.c | 36 ------------------------------------ binding/media-manager.h | 1 - 3 files changed, 38 deletions(-) diff --git a/binding/media-api.c b/binding/media-api.c index 82447b3..ae22fb1 100644 --- a/binding/media-api.c +++ b/binding/media-api.c @@ -130,7 +130,6 @@ static void media_results_get (struct afb_req request) json_object *jresp = NULL; ListLock(); - list = media_local_scan(NULL); list = media_lightmediascanner_scan(list, NULL); if (list == NULL) { afb_req_fail(request, "failed", "media scan error"); diff --git a/binding/media-manager.c b/binding/media-manager.c index 2907972..e0c8ae7 100644 --- a/binding/media-manager.c +++ b/binding/media-manager.c @@ -84,42 +84,6 @@ 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) - { - struct Media_Item *item = g_malloc0(sizeof(*item)); - gchar *p = g_strconcat(path, "/", tmp, NULL); - GStatBuf buf; - - if (g_stat(p, &buf) != 0 || !S_ISREG(buf.st_mode)) { - g_free(p); - continue; - } - - item->path = g_strconcat("file://", p, NULL); - g_free(p); - - list = g_list_append(list, item); - } - - g_free(path); - g_dir_close(dir); - - return list; -} - GList* media_lightmediascanner_scan(GList *list, gchar *uri) { sqlite3 *conn; diff --git a/binding/media-manager.h b/binding/media-manager.h index 148f241..2e5c0d3 100644 --- a/binding/media-manager.h +++ b/binding/media-manager.h @@ -109,7 +109,6 @@ void ListLock(); void ListUnlock(); GList* media_lightmediascanner_scan(GList *list, gchar *uri); -GList* media_local_scan(GList *list); struct Media_Item { gchar *path; -- cgit 1.2.3-korg