rygel r73 - in trunk: . src



Author: zeeshanak
Date: Tue Oct 28 20:59:39 2008
New Revision: 73
URL: http://svn.gnome.org/viewvc/rygel?rev=73&view=rev

Log:
Include the author, creator or artist in the DIDL when available.

Modified:
   trunk/ChangeLog
   trunk/src/gupnp-media-tracker.vala

Modified: trunk/src/gupnp-media-tracker.vala
==============================================================================
--- trunk/src/gupnp-media-tracker.vala	(original)
+++ trunk/src/gupnp-media-tracker.vala	Tue Oct 28 20:59:39 2008
@@ -349,17 +349,21 @@
                                       "File:Mime",
                                       null,
                                       null,
+                                      null,
                                       null};
         if (parent.child_class == VIDEO_CLASS) {
             keys[2] = "Video:Title";
-            keys[3] = "Video:Width";
-            keys[4] = "Video:Height";
+            keys[3] = "Video:Author";
+            keys[4] = "Video:Width";
+            keys[5] = "Video:Height";
         } else if (parent.child_class == IMAGE_CLASS) {
             keys[2] = "Image:Title";
-            keys[3] = "Image:Width";
-            keys[4] = "Image:Height";
+            keys[3] = "Image:Creator";
+            keys[4] = "Image:Width";
+            keys[5] = "Image:Height";
         } else if (parent.child_class == MUSIC_CLASS) {
             keys[2] = "Audio:Title";
+            keys[3] = "Audio:Artist";
         }
 
         string[] values = null;
@@ -378,11 +382,11 @@
         int width = -1;
         int height = -1;
 
-        if (keys[3] != null && values[3] != "")
-            width = values[3].to_int ();
-
         if (keys[4] != null && values[4] != "")
-            height = values[4].to_int ();
+            width = values[4].to_int ();
+
+        if (keys[5] != null && values[5] != "")
+            height = values[5].to_int ();
 
         string title;
         if (values[2] != null && values[2] != "")
@@ -395,6 +399,7 @@
                        parent.id,
                        values[1],
                        title,
+                       values[3],
                        parent.child_class,
                        width,
                        height,
@@ -407,6 +412,7 @@
                            string parent_id,
                            string mime,
                            string title,
+                           string author,
                            string upnp_class,
                            int    width,
                            int    height,
@@ -427,6 +433,26 @@
                                      null,
                                      upnp_class);
 
+        if (author != "") {
+                string prop_name, prop_namespace;
+
+                if (upnp_class == VIDEO_CLASS) {
+                        prop_name = "author";
+                        prop_namespace = DIDLLiteWriter.NAMESPACE_UPNP;
+                } else if (upnp_class == IMAGE_CLASS) {
+                        prop_name = "creator";
+                        prop_namespace = DIDLLiteWriter.NAMESPACE_DC;
+                } else if (upnp_class == MUSIC_CLASS) {
+                        prop_name = "artist";
+                        prop_namespace = DIDLLiteWriter.NAMESPACE_UPNP;
+                }
+
+                this.didl_writer.add_string (prop_name,
+                                prop_namespace,
+                                null,
+                                author);
+        }
+
         this.didl_writer.add_string ("album",
                                      DIDLLiteWriter.NAMESPACE_UPNP,
                                      null,



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