summaryrefslogtreecommitdiff
path: root/graphics/f-spot/patches/patch-FlickrRemote.cs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/f-spot/patches/patch-FlickrRemote.cs')
-rw-r--r--graphics/f-spot/patches/patch-FlickrRemote.cs84
1 files changed, 84 insertions, 0 deletions
diff --git a/graphics/f-spot/patches/patch-FlickrRemote.cs b/graphics/f-spot/patches/patch-FlickrRemote.cs
new file mode 100644
index 00000000000..56567dd09a3
--- /dev/null
+++ b/graphics/f-spot/patches/patch-FlickrRemote.cs
@@ -0,0 +1,84 @@
+$NetBSD: patch-FlickrRemote.cs,v 1.1 2015/05/23 10:33:01 kefren Exp $
+
+Make it compile with newer flickrnet
+
+--- src/Extensions/Exporters/FSpot.Exporters.Flickr/FSpot.Exporters.Flickr/FlickrRemote.cs.orig 2010-12-19 15:34:42.000000000 +0200
++++ src/Extensions/Exporters/FSpot.Exporters.Flickr/FSpot.Exporters.Flickr/FlickrRemote.cs 2015-05-23 13:25:26.000000000 +0300
+@@ -11,6 +11,7 @@
+ */
+ using System;
+ using System.IO;
++using System.Linq;
+ using System.Text;
+ using System.Collections;
+ using FlickrNet;
+@@ -22,7 +23,7 @@
+
+ namespace FSpot.Exporters.Flickr {
+ public class FlickrRemote {
+- public static Licenses licenses;
++ public static LicenseCollection licenses;
+ private string frob;
+ private string token;
+ private Auth auth;
+@@ -62,28 +63,29 @@
+ get { return flickr; }
+ }
+
+- public License[] GetLicenses ()
++ public LicenseCollection GetLicenses ()
+ {
+ // Licenses won't change normally in a user session
+ if (licenses == null) {
+ try {
+ licenses = flickr.PhotosLicensesGetInfo();
+ } catch (FlickrNet.FlickrApiException e ) {
+- Log.Error (e.Code + ": " + e.Verbose );
++ Log.Error (e.Code + ": " + e.Message );
+ return null;
+ }
+ }
+- return licenses.LicenseCollection;
++ return licenses;
+ }
+
+ public ArrayList Search (string[] tags, int licenseId)
+ {
++ var options = new PhotoSearchOptions { Tags = tags.Aggregate((a, b) => a += b + " ") };
+ ArrayList photos_url = new ArrayList ();
+ // Photos photos = flickr.PhotosSearchText (tags, licenseId);
+- Photos photos = flickr.PhotosSearch (tags);
++ PhotoCollection photos = flickr.PhotosSearch (options);
+
+ if (photos != null) {
+- foreach (FlickrNet.Photo photo in photos.PhotoCollection) {
++ foreach (FlickrNet.Photo photo in photos) {
+ photos_url.Add (photo.ThumbnailUrl);
+ }
+ }
+@@ -93,11 +95,14 @@
+
+ public ArrayList Search (string tags, int licenseId)
+ {
++ var options = new PhotoSearchOptions{Tags = tags};
+ ArrayList photos_url = new ArrayList ();
+- Photos photos = flickr.PhotosSearchText (tags, licenseId);
++ // XXX: ignore license, probably should also set
++ // options.licenses
++ PhotoCollection photos = flickr.PhotosSearch (options);
+
+ if (photos != null) {
+- foreach (FlickrNet.Photo photo in photos.PhotoCollection) {
++ foreach (FlickrNet.Photo photo in photos) {
+ photos_url.Add (photo.ThumbnailUrl);
+ }
+ }
+@@ -126,7 +131,7 @@
+
+ return auth;
+ } catch (FlickrNet.FlickrApiException ex) {
+- Log.Error ("Problems logging in to Flickr - " + ex.Verbose);
++ Log.Error ("Problems logging in to Flickr - " + ex.Message);
+ return null;
+ }
+ }