[shotwell] Better metadata support for Facebook sharing: Bug #742163



commit eae085285686503c5318d4bae5033c411eef5dd2
Author: Eduardo Arnold <eduardoarnoldh gmail com>
Date:   Thu Feb 5 14:15:27 2015 -0800

    Better metadata support for Facebook sharing: Bug #742163

 THANKS                                             |    1 +
 .../shotwell-publishing/FacebookPublishing.vala    |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/THANKS b/THANKS
index d30821d..6ea1b40 100644
--- a/THANKS
+++ b/THANKS
@@ -8,6 +8,7 @@ Patrick Tierney <patrick yorba org>
 Simon Adda-Reyss <simon addareyss libertysurf fr>
 Mihhail Afanasjev <mihhail afanasjev gmail com>
 Joeny Ang <ang joeny gmail com>
+Eduardo Arnold <eduardoarnoldh gmail com>
 Jeroen Arnoldus <b j arnoldus bja-electronics nl>
 Michael Axiak <mike axiak net>
 Eser Aygün <eser aygun gmail com>
diff --git a/plugins/shotwell-publishing/FacebookPublishing.vala 
b/plugins/shotwell-publishing/FacebookPublishing.vala
index 79b7a0a..9d31a61 100644
--- a/plugins/shotwell-publishing/FacebookPublishing.vala
+++ b/plugins/shotwell-publishing/FacebookPublishing.vala
@@ -1393,9 +1393,19 @@ internal class GraphSession {
             if (publishable.get_media_type() == Spit.Publishing.Publisher.MediaType.VIDEO)
                 mp_envelope.append_form_string("privacy", resource_privacy);
             
-            string publishable_title = publishable.get_publishing_name();
-            if (!suppress_titling && publishable_title != "")
+            //Get photo title and post it as message on FB API
+            string publishable_title = publishable.get_param_string("title");
+            if (!suppress_titling && publishable_title != null)
                 mp_envelope.append_form_string("name", publishable_title);
+                
+            //Set 'message' data field with EXIF comment field. Title has precedence.
+            string publishable_comment = publishable.get_param_string("comment");
+            if (!suppress_titling && publishable_comment != null)
+               mp_envelope.append_form_string("message", publishable_comment);
+            
+            //Sets correct date of the picture
+            if (!suppress_titling)
+               mp_envelope.append_form_string("backdated_time", 
publishable.get_exposure_date_time().to_string());
 
             string source_file_mime_type =
                 (publishable.get_media_type() == Spit.Publishing.Publisher.MediaType.VIDEO) ?


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