[PATCH] tracker: use "nfo" ontologies for media



nfo:Audio, nfo:Video, nfo:Image (file objects) make more sense than
the nmm counterparts (multimedia objects): as an example, not all
Photos will be marked as such, they may be just Images.
---

There is a theoretical possibility of problems here: nmm:MusicPiece is
_not_ a subclass of nfo:Audio (this is a tracker bug, see 
https://bugzilla.gnome.org/show_bug.cgi?id=641248). In reality this should
not break anything as all tracker extractors currently set both types.

 src/tracker/grl-tracker.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/tracker/grl-tracker.c b/src/tracker/grl-tracker.c
index 735b0e9..daea2fc 100644
--- a/src/tracker/grl-tracker.c
+++ b/src/tracker/grl-tracker.c
@@ -46,9 +46,8 @@ GRL_LOG_DOMAIN_STATIC(tracker_log_domain);
 #define RDF_TYPE_ALBUM  "nmm#MusicAlbum"
 #define RDF_TYPE_ARTIST "nmm#Artist"
 #define RDF_TYPE_AUDIO  "nfo#Audio"
-#define RDF_TYPE_MUSIC  "nmm#MusicPiece"
-#define RDF_TYPE_IMAGE  "nmm#Photo"
-#define RDF_TYPE_VIDEO  "nmm#Video"
+#define RDF_TYPE_IMAGE  "nfo#Image"
+#define RDF_TYPE_VIDEO  "nfo#Video"
 #define RDF_TYPE_BOX    "grilo#Box"
 
 /* ---- Plugin information --- */
@@ -959,7 +958,7 @@ build_grilo_media (const gchar *rdf_type)
   i = g_strv_length (rdf_single_type) - 1;
 
   while (!media && i >= 0) {
-    if (g_str_has_suffix (rdf_single_type[i], RDF_TYPE_MUSIC)) {
+    if (g_str_has_suffix (rdf_single_type[i], RDF_TYPE_AUDIO)) {
       media = grl_media_audio_new ();
     } else if (g_str_has_suffix (rdf_single_type[i], RDF_TYPE_VIDEO)) {
       media = grl_media_video_new ();
@@ -1237,17 +1236,17 @@ grl_tracker_source_supported_keys (GrlMetadataSource *source)
  * <itemizedlist>
  *   <listitem>
  *     <para>
- *       <literal>nmm#MusicPiece</literal>
+ *       <literal>nfo#Audio</literal>
  *     </para>
  *   </listitem>
  *   <listitem>
  *     <para>
- *       <literal>nmm#Video</literal>
+ *       <literal>nfo#Video</literal>
  *     </para>
  *   </listitem>
  *   <listitem>
  *     <para>
- *       <literal>nmm#Photo</literal>
+ *       <literal>nfo#Image</literal>
  *     </para>
  *   </listitem>
  *   <listitem>
@@ -1275,7 +1274,7 @@ grl_tracker_source_supported_keys (GrlMetadataSource *source)
  *            ?song            AS id
  *            nie:title(?song) AS title
  *            nie:url(?song)   AS url
- *     WHERE { ?song a nmm:MusicPiece }
+ *     WHERE { ?song a nfo:Audio }
  *   </programlisting>
  * </informalexample>
  *
@@ -1448,17 +1447,17 @@ grl_tracker_source_browse (GrlMediaSource *source,
     /* Hardcoded categories */
     media = grl_media_box_new ();
     grl_media_set_title (media, "Music");
-    grl_media_set_id (media, "nmm:MusicPiece");
+    grl_media_set_id (media, "nfo:Audio");
     bs->callback (bs->source, bs->browse_id, media, 2, bs->user_data, NULL);
 
     media = grl_media_box_new ();
-    grl_media_set_title (media, "Photo");
-    grl_media_set_id (media, "nmm:Photo");
+    grl_media_set_title (media, "Image");
+    grl_media_set_id (media, "nfo:Image");
     bs->callback (bs->source, bs->browse_id, media, 1, bs->user_data, NULL);
 
     media = grl_media_box_new ();
     grl_media_set_title (media, "Video");
-    grl_media_set_id (media, "nmm:Video");
+    grl_media_set_id (media, "nfo:Video");
     bs->callback (bs->source, bs->browse_id, media, 0, bs->user_data, NULL);
     return;
   }
-- 
1.7.2.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]