rygel r368 - trunk/src/plugins/tracker



Author: zeeshanak
Date: Thu Dec 25 11:59:42 2008
New Revision: 368
URL: http://svn.gnome.org/viewvc/rygel?rev=368&view=rev

Log:
Include file size of the item in the DIDL.

Modified:
   trunk/src/plugins/tracker/rygel-tracker-image-item.vala
   trunk/src/plugins/tracker/rygel-tracker-music-item.vala
   trunk/src/plugins/tracker/rygel-tracker-video-item.vala

Modified: trunk/src/plugins/tracker/rygel-tracker-image-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-image-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-image-item.vala	Thu Dec 25 11:59:42 2008
@@ -40,6 +40,7 @@
     public override void fetch_metadata () throws GLib.Error {
         string[] keys = new string[] {"File:Name",
                                       "File:Mime",
+                                      "File:Size",
                                       "Image:Title",
                                       "Image:Creator",
                                       "Image:Width",
@@ -60,29 +61,35 @@
             return;
         }
 
-        if (values[2] != "")
-            this.title = values[2];
+        if (values[3] != "")
+            this.title = values[3];
         else
             /* If title wasn't provided, use filename instead */
             this.title = values[0];
 
-        if (values[4] != "")
-            this.res.width = values[4].to_int ();
+        if (values[2] != "")
+            this.res.size = values[2].to_int ();
 
         if (values[5] != "")
-            this.res.height = values[5].to_int ();
+            this.res.width = values[5].to_int ();
 
-        if (values[8] != "") {
-            this.date = seconds_to_iso8601 (values[8]);
+        if (values[6] != "")
+            this.res.height = values[6].to_int ();
+
+        if (values[2] != "")
+            this.res.size = values[2].to_int ();
+
+        if (values[9] != "") {
+            this.date = seconds_to_iso8601 (values[9]);
         } else {
-            this.date = seconds_to_iso8601 (values[7]);
+            this.date = seconds_to_iso8601 (values[8]);
         }
 
         // FIXME: (Leaky) Hack to assign the string to weak fields
         string *mime = #values[1];
         this.res.mime_type = mime;
-        this.author = values[3];
-        this.album = values[6];
+        this.author = values[4];
+        this.album = values[7];
         string *uri = this.uri_from_path (path);
         this.res.uri = uri;
     }

Modified: trunk/src/plugins/tracker/rygel-tracker-music-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-music-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-music-item.vala	Thu Dec 25 11:59:42 2008
@@ -40,6 +40,7 @@
     public override void fetch_metadata () throws GLib.Error {
         string[] keys = new string[] {"File:Name",
                                       "File:Mime",
+                                      "File:Size",
                                       "Audio:Title",
                                       "Audio:Artist",
                                       "Audio:TrackNo",
@@ -60,28 +61,31 @@
             return;
         }
 
-        if (values[2] != "")
-            this.title = values[2];
+        if (values[3] != "")
+            this.title = values[3];
         else
             /* If title wasn't provided, use filename instead */
             this.title = values[0];
 
-        if (values[4] != "")
-            this.track_number = values[4].to_int ();
+        if (values[2] != "")
+            this.res.size = values[2].to_int ();
 
-        if (values[8] != "") {
-            this.date = seconds_to_iso8601 (values[8]);
-        } else if (values[6] != "") {
-            this.date = seconds_to_iso8601 (values[6]);
-        } else {
+        if (values[5] != "")
+            this.track_number = values[5].to_int ();
+
+        if (values[9] != "") {
+            this.date = seconds_to_iso8601 (values[9]);
+        } else if (values[7] != "") {
             this.date = seconds_to_iso8601 (values[7]);
+        } else {
+            this.date = seconds_to_iso8601 (values[8]);
         }
 
         // FIXME: (Leaky) Hack to assign the string to weak fields
         string *mime = #values[1];
         this.res.mime_type = mime;
-        this.author = values[3];
-        this.album = values[5];
+        this.author = values[4];
+        this.album = values[6];
         string *uri = this.uri_from_path (path);
         this.res.uri = uri;
     }

Modified: trunk/src/plugins/tracker/rygel-tracker-video-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-video-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-video-item.vala	Thu Dec 25 11:59:42 2008
@@ -40,6 +40,7 @@
     public override void fetch_metadata () throws GLib.Error {
         string[] keys = new string[] {"File:Name",
                                       "File:Mime",
+                                      "File:Size",
                                       "Video:Title",
                                       "Video:Author",
                                       "Video:Width",
@@ -58,23 +59,26 @@
             return;
         }
 
-        if (values[2] != "")
-            this.title = values[2];
+        if (values[3] != "")
+            this.title = values[3];
         else
             /* If title wasn't provided, use filename instead */
             this.title = values[0];
 
-        if (values[4] != "")
-            this.res.width = values[4].to_int ();
+        if (values[2] != "")
+            this.res.size = values[2].to_int ();
 
         if (values[5] != "")
-            this.res.height = values[5].to_int ();
+            this.res.width = values[5].to_int ();
+
+        if (values[6] != "")
+            this.res.height = values[6].to_int ();
 
-        this.date = this.seconds_to_iso8601 (values[6]);
+        this.date = this.seconds_to_iso8601 (values[7]);
         // FIXME: (Leaky) Hack to assign the string to weak fields
         string *mime = #values[1];
         this.res.mime_type = mime;
-        this.author = values[3];
+        this.author = values[4];
         string *uri = this.uri_from_path (path);
         this.res.uri = uri;
     }



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