summaryrefslogtreecommitdiffstats
path: root/binding/media-manager.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-12-07 17:57:38 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-12-09 20:57:46 -0800
commit91126397febe969a6ee94f9baff6337568ee7c65 (patch)
tree78b5204b8695afc1bf6bf87791db47e2add1e1bf /binding/media-manager.c
parent34aeacdb140533e04e2d6d9512bc25c342135dc7 (diff)
binding: mediascanner: add video scan from lightmediascanner
Add to the playlist the video media found from the lightmediascanner database. Bug-AGL: SPEC-1169 Change-Id: I9ebf2e21805fe0e59a853dd081eacf02af501c96 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/media-manager.c')
-rw-r--r--binding/media-manager.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/binding/media-manager.c b/binding/media-manager.c
index e0c8ae7..46c7d1d 100644
--- a/binding/media-manager.c
+++ b/binding/media-manager.c
@@ -84,7 +84,7 @@ void DebugTraceSendMsg(int level, gchar* message)
}
-GList* media_lightmediascanner_scan(GList *list, gchar *uri)
+GList* media_lightmediascanner_scan(GList *list, gchar *uri, int scan_type)
{
sqlite3 *conn;
sqlite3_stmt *res;
@@ -101,7 +101,15 @@ GList* media_lightmediascanner_scan(GList *list, gchar *uri)
return NULL;
}
- query = g_strdup_printf(SQL_QUERY, uri ? uri : "");
+ switch (scan_type) {
+ case LMS_VIDEO_SCAN:
+ query = g_strdup_printf(VIDEO_SQL_QUERY, uri ? uri : "");
+ break;
+ case LMS_AUDIO_SCAN:
+ default:
+ query = g_strdup_printf(AUDIO_SQL_QUERY, uri ? uri : "");
+ }
+
if (!query) {
LOGE("Cannot allocate memory for query\n");
return NULL;
@@ -183,7 +191,8 @@ on_interface_proxy_properties_changed (GDBusProxy *proxy,
ListLock();
- list = media_lightmediascanner_scan(list, MediaPlayerManage.uri_filter);
+ list = media_lightmediascanner_scan(list, MediaPlayerManage.uri_filter, LMS_AUDIO_SCAN);
+ list = media_lightmediascanner_scan(list, MediaPlayerManage.uri_filter, LMS_VIDEO_SCAN);
g_free(MediaPlayerManage.uri_filter);
MediaPlayerManage.uri_filter = NULL;