summaryrefslogtreecommitdiff
path: root/plugins/shotwell-publishing
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2021-08-22 09:58:25 +0200
committerJörg Frings-Fürst <debian@jff.email>2021-08-22 09:58:25 +0200
commit55d274a13c2524d55e07f2395316aa9d2cae912b (patch)
treeed56dbd62e0ce978ab83e8ffe2d6034e612d028f /plugins/shotwell-publishing
parentfa96deefd4bc785c2937e40df3eb0742e2353c13 (diff)
parent63876b56fcba61ef061c5f0edd924551bc079354 (diff)
Merge branch 'release/debian/0.30.14-1'debian/0.30.14-1
Diffstat (limited to 'plugins/shotwell-publishing')
-rw-r--r--plugins/shotwell-publishing/PhotosPublisher.vala52
-rw-r--r--plugins/shotwell-publishing/PiwigoPublishing.vala2
-rw-r--r--plugins/shotwell-publishing/org.gnome.Shotwell.Publishing.gresource.xml2
-rw-r--r--plugins/shotwell-publishing/piwigo.pngbin3148 -> 0 bytes
-rw-r--r--plugins/shotwell-publishing/piwigo.svg96
5 files changed, 131 insertions, 21 deletions
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();
+ }
}
}
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 @@
<gresources>
<gresource prefix="/org/gnome/Shotwell/Publishing">
<file>facebook.png</file>
- <file>piwigo.png</file>
+ <file>piwigo.svg</file>
<file>youtube.png</file>
<file>tumblr.png</file>
<file>google-photos.svg</file>
diff --git a/plugins/shotwell-publishing/piwigo.png b/plugins/shotwell-publishing/piwigo.png
deleted file mode 100644
index cf9dbc3..0000000
--- a/plugins/shotwell-publishing/piwigo.png
+++ /dev/null
Binary files 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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="36.070644mm"
+ height="38.568047mm"
+ viewBox="0 0 36.070644 38.568047"
+ version="1.1"
+ id="svg117"
+ inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+ sodipodi:docname="piwigo.svg">
+ <defs
+ id="defs111" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.0566338"
+ inkscape:cx="315.37246"
+ inkscape:cy="286.50299"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ inkscape:document-rotation="0"
+ showgrid="false"
+ inkscape:window-width="1530"
+ inkscape:window-height="1011"
+ inkscape:window-x="50"
+ inkscape:window-y="32"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata114">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-2.864242,-8.1819078)">
+ <g
+ id="g145"
+ transform="translate(85.911469,-9.5757352)">
+ <path
+ id="Tracé_3467"
+ data-name="Tracé 3467"
+ class="cls-2"
+ d="M -83.047227,46.768941 V 29.812324 a 9.5567499,9.5567499 0 0 1 9.55675,-9.55675 h 22.466035 l 2.743465,1.281113 1.304395,2.778125 v 22.454129 a 9.5567499,9.5567499 0 0 1 -9.557279,9.556749 h -16.956616 a 9.5567499,9.5567499 0 0 1 -9.55675,-9.556749 z"
+ style="fill:#ff7700;stroke-width:0.264583" />
+ <path
+ id="Tracé_3469"
+ data-name="Tracé 3469"
+ class="cls-2"
+ d="m -53.583227,17.757643 c 3.578754,0 6.601089,2.881842 6.601089,6.460596 0,3.578754 -3.022335,6.499489 -6.601089,6.499489 -3.578754,0 -16.150431,-10.454745 -15.863623,-10.456333 0.286808,-0.0016 -7.249583,-0.02011 2.427817,0 9.677399,0.02011 9.270999,-2.409825 13.435806,-2.503752 z"
+ style="fill:#ff7700;stroke-width:0.264583" />
+ <circle
+ id="Ellipse_69"
+ data-name="Ellipse 69"
+ class="cls-3"
+ cx="-53.440086"
+ cy="24.112671"
+ r="2.2640395"
+ style="fill:#ffffff;stroke-width:0.264583" />
+ <circle
+ id="Ellipse_67"
+ data-name="Ellipse 67"
+ class="cls-3"
+ cx="-65.012169"
+ cy="38.29063"
+ r="10.696045"
+ style="fill:#ffffff;stroke-width:0.264583" />
+ <circle
+ id="Ellipse_68"
+ data-name="Ellipse 68"
+ class="cls-1"
+ cx="-65.012169"
+ cy="38.290897"
+ r="7.5731683"
+ style="fill:#3c3c3c;stroke-width:0.264583" />
+ </g>
+ </g>
+</svg>