[shotwell/wip/flickr-description: 1/7] Flickr: Set description and title



commit ac05e40e00045471c6144ffc85be3531c63ecb32
Author: Jens Georg <mail jensge org>
Date:   Wed Mar 11 22:59:26 2020 +0100

    Flickr: Set description and title
    
    Instead of relying on Flikckr to pick up the correct tag
    
    Fixes #216

 plugins/shotwell-publishing/FlickrPublishing.vala | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/plugins/shotwell-publishing/FlickrPublishing.vala 
b/plugins/shotwell-publishing/FlickrPublishing.vala
index 53b6003c..f5092753 100644
--- a/plugins/shotwell-publishing/FlickrPublishing.vala
+++ b/plugins/shotwell-publishing/FlickrPublishing.vala
@@ -84,6 +84,7 @@ internal class PublishingParameters {
     public int photo_major_axis_size;
     public string username;
     public VisibilitySpecification visibility_specification;
+    public bool strip_metadata;
 
     public PublishingParameters() {
     }
@@ -506,7 +507,7 @@ private class UploadTransaction : Publishing.RESTSupport.OAuth1.UploadTransactio
 
     public UploadTransaction(Publishing.RESTSupport.OAuth1.Session session, PublishingParameters parameters,
         Spit.Publishing.Publishable publishable) {
-        base(session, publishable, "https://api.flickr.com/services/upload";);
+        base(session, publishable, "https://up.flickr.com/services/upload";);
 
         this.parameters = parameters;
 
@@ -514,6 +515,18 @@ private class UploadTransaction : Publishing.RESTSupport.OAuth1.UploadTransactio
         add_argument("is_friend", ("%d".printf(parameters.visibility_specification.friends_level)));
         add_argument("is_family", ("%d".printf(parameters.visibility_specification.family_level)));
 
+        if (!parameters.strip_metadata) {
+            var title = publishable.get_param_string(Spit.Publishing.Publishable.PARAM_STRING_TITLE);
+            if (title != null && title != "") {
+                add_argument("title", title);
+            }
+
+            var comment = publishable.get_param_string(Spit.Publishing.Publishable.PARAM_STRING_COMMENT);
+            if (comment != null && comment != "") {
+                add_argument("description", comment);
+            }
+        }
+
         GLib.HashTable<string, string> disposition_table =
             new GLib.HashTable<string, string>(GLib.str_hash, GLib.str_equal);
         string? filename = publishable.get_publishing_name();
@@ -646,6 +659,7 @@ internal class PublishingOptionsPane : Spit.Publishing.DialogPane, GLib.Object {
     }
 
     private void on_publish_clicked() {
+        parameters.strip_metadata = strip_metadata_check.get_active();
         parameters.visibility_specification =
             visibilities[visibility_combo.get_active()].specification;
 


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