summaryrefslogtreecommitdiffstats
path: root/binding/media-manager.h
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-10-01 16:38:49 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-10-05 20:13:15 -0700
commit47593c4e5a71a95fb5ee9824e7bef8bf31d4f41f (patch)
tree6e3f3954b8aa8ed2ac9b3fe1c3973b4bd2ba9c4f /binding/media-manager.h
parentaa7bfb7a49ef4e2b9e7334330650c9550eb3892a (diff)
binding: mediascanner: add media metadata to JSON output
Add metadata of the tracks artist, title, album and genre to the JSON output for media results. Bug-AGL: SPEC-924 Change-Id: I240481b3b36909cb2de6ff7ba5c0a168d7973dc2 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/media-manager.h')
-rw-r--r--binding/media-manager.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/binding/media-manager.h b/binding/media-manager.h
index 34d87e1..f1f177e 100644
--- a/binding/media-manager.h
+++ b/binding/media-manager.h
@@ -74,7 +74,15 @@ void DebugTraceSendMsg(int level, gchar* message);
#define FREEDESKTOP_PROPERTIES "org.freedesktop.DBus.Properties"
//sqlite
-#define SQL_QUERY "SELECT files.path FROM files LEFT JOIN audios " \
+#define SQL_QUERY "SELECT files.path, audios.title, audio_artists.name, " \
+ "audio_albums.name, audio_genres.name, audios.length " \
+ "FROM files LEFT JOIN audios " \
+ "LEFT JOIN audio_artists " \
+ "ON audio_artists.id = audios.artist_id " \
+ "LEFT JOIN audio_albums " \
+ "ON audio_albums.id = audios.album_id " \
+ "LEFT JOIN audio_genres " \
+ "ON audio_genres.id = audios.genre_id " \
"WHERE audios.id = files.id ORDER BY " \
"audios.artist_id, audios.album_id, audios.trackno"
@@ -100,4 +108,15 @@ void ListUnlock();
GList* media_lightmediascanner_scan(void);
GList* media_local_scan(GList *list);
+struct Media_Item {
+ gchar *path;
+ struct {
+ gchar *title;
+ gchar *artist;
+ gchar *album;
+ gchar *genre;
+ gint duration;
+ } metadata;
+};
+
#endif