summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-10-10 17:00:19 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-10-10 17:00:31 -0700
commit1650598e40ed96588039b73453d3a813bc7c1926 (patch)
tree57c79b022c6d75624c100e5c72b0cbd33fabd111
parentcc0456ed42fe31edc081606d1c1c39d0703a6c05 (diff)
binding: mediascanner: scan for local media first
Scan for local media first to allow the playlist to be concise. Bug-AGL: SPEC-934 Change-Id: Ic3d1b3e80fd67ac79d4d51b602754d81a2ebf903 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--binding/media-api.c4
-rw-r--r--binding/media-manager.c7
-rw-r--r--binding/media-manager.h2
3 files changed, 6 insertions, 7 deletions
diff --git a/binding/media-api.c b/binding/media-api.c
index fb0145f..82447b3 100644
--- a/binding/media-api.c
+++ b/binding/media-api.c
@@ -130,8 +130,8 @@ static void media_results_get (struct afb_req request)
json_object *jresp = NULL;
ListLock();
- list = media_lightmediascanner_scan(NULL);
- list = media_local_scan(list);
+ list = media_local_scan(NULL);
+ list = media_lightmediascanner_scan(list, NULL);
if (list == NULL) {
afb_req_fail(request, "failed", "media scan error");
ListUnlock();
diff --git a/binding/media-manager.c b/binding/media-manager.c
index 63dd4ff..445c7f9 100644
--- a/binding/media-manager.c
+++ b/binding/media-manager.c
@@ -109,11 +109,10 @@ GList* media_local_scan(GList *list)
return list;
}
-GList* media_lightmediascanner_scan(gchar *uri)
+GList* media_lightmediascanner_scan(GList *list, gchar *uri)
{
sqlite3 *conn;
sqlite3_stmt *res;
- GList *list = NULL;
const char *tail;
const gchar *db_path;
gchar *query;
@@ -185,7 +184,7 @@ on_interface_proxy_properties_changed (GDBusProxy *proxy,
const gchar *key;
GVariant *subValue;
const gchar *pInterface;
- GList *list;
+ GList *list = NULL;
pInterface = g_dbus_proxy_get_interface_name (proxy);
@@ -209,7 +208,7 @@ on_interface_proxy_properties_changed (GDBusProxy *proxy,
ListLock();
- list = media_lightmediascanner_scan(MediaPlayerManage.uri_filter);
+ list = media_lightmediascanner_scan(list, MediaPlayerManage.uri_filter);
g_free(MediaPlayerManage.uri_filter);
MediaPlayerManage.uri_filter = NULL;
diff --git a/binding/media-manager.h b/binding/media-manager.h
index 69c866b..148f241 100644
--- a/binding/media-manager.h
+++ b/binding/media-manager.h
@@ -108,7 +108,7 @@ int MediaPlayerManagerInit(void);
void ListLock();
void ListUnlock();
-GList* media_lightmediascanner_scan(gchar *uri);
+GList* media_lightmediascanner_scan(GList *list, gchar *uri);
GList* media_local_scan(GList *list);
struct Media_Item {