summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--binding/media-api.c3
-rw-r--r--binding/media-manager.c6
-rw-r--r--binding/media-manager.h4
3 files changed, 13 insertions, 0 deletions
diff --git a/binding/media-api.c b/binding/media-api.c
index 892f67d..065b258 100644
--- a/binding/media-api.c
+++ b/binding/media-api.c
@@ -88,6 +88,9 @@ static json_object *new_json_object_from_device(GList *list)
jstring = json_object_new_string(item->path);
json_object_object_add(jdict, "path", jstring);
+ jstring = json_object_new_string(lms_scan_types[item->type]);
+ json_object_object_add(jdict, "type", jstring);
+
if (item->metadata.title) {
jstring = json_object_new_string(item->metadata.title);
json_object_object_add(jdict, "title", jstring);
diff --git a/binding/media-manager.c b/binding/media-manager.c
index 46c7d1d..a1f228a 100644
--- a/binding/media-manager.c
+++ b/binding/media-manager.c
@@ -33,6 +33,11 @@
#include "media-manager.h"
+const char *lms_scan_types[] = {
+ "audio",
+ "video",
+};
+
static Binding_RegisterCallback_t g_RegisterCallback = { 0 };
static stMediaPlayerManage MediaPlayerManage = { 0 };
@@ -133,6 +138,7 @@ GList* media_lightmediascanner_scan(GList *list, gchar *uri, int scan_type)
item = g_malloc0(sizeof(*item));
item->path = g_strdup_printf("file://%s", path);
+ item->type = scan_type;
item->metadata.title = g_strdup((gchar *) sqlite3_column_text(res, 1));
item->metadata.artist = g_strdup((gchar *) sqlite3_column_text(res, 2));
item->metadata.album = g_strdup((gchar *) sqlite3_column_text(res, 3));
diff --git a/binding/media-manager.h b/binding/media-manager.h
index 37621b0..7f204fe 100644
--- a/binding/media-manager.h
+++ b/binding/media-manager.h
@@ -120,6 +120,7 @@ GList* media_lightmediascanner_scan(GList *list, gchar *uri, int scan_type);
struct Media_Item {
gchar *path;
+ gint type;
struct {
gchar *title;
gchar *artist;
@@ -132,6 +133,9 @@ struct Media_Item {
enum {
LMS_AUDIO_SCAN,
LMS_VIDEO_SCAN,
+ LMS_SCAN_COUNT,
};
+extern const char *lms_scan_types[LMS_SCAN_COUNT];
+
#endif