From eee242571f78cedcca283c6396026c80640572c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 24 May 2021 15:23:46 +0200 Subject: New upstream version 0.30.12 --- plugins/shotwell-publishing/PiwigoPublishing.vala | 2 +- .../org.gnome.Shotwell.Publishing.gresource.xml | 2 +- plugins/shotwell-publishing/piwigo.png | Bin 3148 -> 0 bytes plugins/shotwell-publishing/piwigo.svg | 96 +++++++++++++++++++++ 4 files changed, 98 insertions(+), 2 deletions(-) delete mode 100644 plugins/shotwell-publishing/piwigo.png create mode 100644 plugins/shotwell-publishing/piwigo.svg (limited to 'plugins/shotwell-publishing') diff --git a/plugins/shotwell-publishing/PiwigoPublishing.vala b/plugins/shotwell-publishing/PiwigoPublishing.vala index f177789..d311ac5 100644 --- a/plugins/shotwell-publishing/PiwigoPublishing.vala +++ b/plugins/shotwell-publishing/PiwigoPublishing.vala @@ -5,7 +5,7 @@ */ public class PiwigoService : Object, Spit.Pluggable, Spit.Publishing.Service { - private const string ICON_FILENAME = "piwigo.png"; + private const string ICON_FILENAME = "piwigo.svg"; private static Gdk.Pixbuf[] icon_pixbuf_set = null; diff --git a/plugins/shotwell-publishing/org.gnome.Shotwell.Publishing.gresource.xml b/plugins/shotwell-publishing/org.gnome.Shotwell.Publishing.gresource.xml index 436ea9e..e04ab02 100644 --- a/plugins/shotwell-publishing/org.gnome.Shotwell.Publishing.gresource.xml +++ b/plugins/shotwell-publishing/org.gnome.Shotwell.Publishing.gresource.xml @@ -2,7 +2,7 @@ facebook.png - piwigo.png + piwigo.svg youtube.png tumblr.png google-photos.svg diff --git a/plugins/shotwell-publishing/piwigo.png b/plugins/shotwell-publishing/piwigo.png deleted file mode 100644 index cf9dbc3..0000000 Binary files a/plugins/shotwell-publishing/piwigo.png and /dev/null differ diff --git a/plugins/shotwell-publishing/piwigo.svg b/plugins/shotwell-publishing/piwigo.svg new file mode 100644 index 0000000..fa5933c --- /dev/null +++ b/plugins/shotwell-publishing/piwigo.svg @@ -0,0 +1,96 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + -- cgit v1.2.3 From 2ed34746222ea505631ae8ef8ca50552af999ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 18 Aug 2021 20:39:21 +0200 Subject: New upstream version 0.30.14 --- plugins/shotwell-publishing/PhotosPublisher.vala | 52 +++++++++++++++--------- 1 file changed, 33 insertions(+), 19 deletions(-) (limited to 'plugins/shotwell-publishing') diff --git a/plugins/shotwell-publishing/PhotosPublisher.vala b/plugins/shotwell-publishing/PhotosPublisher.vala index 5f46470..e1127ac 100644 --- a/plugins/shotwell-publishing/PhotosPublisher.vala +++ b/plugins/shotwell-publishing/PhotosPublisher.vala @@ -7,6 +7,7 @@ namespace Publishing.GooglePhotos { internal const string DEFAULT_ALBUM_NAME = N_("Shotwell Connect"); +internal const int MAX_BATCH_SIZE = 50; internal class Album { public string name; @@ -127,28 +128,41 @@ private class MediaCreationTransaction : Publishing.RESTSupport.GooglePublisher. } public override void execute () throws Spit.Publishing.PublishingError { - var builder = new Json.Builder(); - builder.begin_object(); - builder.set_member_name("albumId"); - builder.add_string_value(this.album_id); - builder.set_member_name("newMediaItems"); - builder.begin_array(); - for (var i = 0; i < this.upload_tokens.length; i++) { - builder.begin_object(); - builder.set_member_name("description"); - builder.add_string_value(this.titles[i]); - builder.set_member_name("simpleMediaItem"); + for (var h = 0; h * MAX_BATCH_SIZE < this.upload_tokens.length; h++) { + var offset = h * MAX_BATCH_SIZE; + var difference = this.upload_tokens.length - offset; + int end; + + if (difference > MAX_BATCH_SIZE) { + end = offset + MAX_BATCH_SIZE; + } + else { + end = offset + difference; + } + + var builder = new Json.Builder(); builder.begin_object(); - builder.set_member_name("uploadToken"); - builder.add_string_value(this.upload_tokens[i]); - builder.end_object(); + builder.set_member_name("albumId"); + builder.add_string_value(this.album_id); + builder.set_member_name("newMediaItems"); + builder.begin_array(); + for (var i = offset; i < end; i++) { + builder.begin_object(); + builder.set_member_name("description"); + builder.add_string_value(this.titles[i]); + builder.set_member_name("simpleMediaItem"); + builder.begin_object(); + builder.set_member_name("uploadToken"); + builder.add_string_value(this.upload_tokens[i]); + builder.end_object(); + builder.end_object(); + } + builder.end_array(); builder.end_object(); - } - builder.end_array(); - builder.end_object(); - set_custom_payload(Json.to_string (builder.get_root (), false), "application/json"); + set_custom_payload(Json.to_string (builder.get_root (), false), "application/json"); - base.execute(); + base.execute(); + } } } -- cgit v1.2.3