| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | $NetBSD: patch-FlickrRemote.cs,v 1.1 2015/05/23 10:33:01 kefren Exp $ | | 1 | $NetBSD: patch-FlickrRemote.cs,v 1.2 2015/05/24 06:50:14 kefren Exp $ |
2 | | | 2 | |
3 | Make it compile with newer flickrnet | | 3 | Make it compile with newer flickrnet |
4 | | | 4 | |
5 | --- src/Extensions/Exporters/FSpot.Exporters.Flickr/FSpot.Exporters.Flickr/FlickrRemote.cs.orig 2010-12-19 15:34:42.000000000 +0200 | | 5 | --- src/Extensions/Exporters/FSpot.Exporters.Flickr/FSpot.Exporters.Flickr/FlickrRemote.cs.orig 2010-12-19 15:34:42.000000000 +0200 |
6 | +++ src/Extensions/Exporters/FSpot.Exporters.Flickr/FSpot.Exporters.Flickr/FlickrRemote.cs 2015-05-23 13:25:26.000000000 +0300 | | 6 | +++ src/Extensions/Exporters/FSpot.Exporters.Flickr/FSpot.Exporters.Flickr/FlickrRemote.cs 2015-05-23 13:25:26.000000000 +0300 |
7 | @@ -11,6 +11,7 @@ | | 7 | @@ -11,6 +11,7 @@ |
8 | */ | | 8 | */ |
9 | using System; | | 9 | using System; |
10 | using System.IO; | | 10 | using System.IO; |
11 | +using System.Linq; | | 11 | +using System.Linq; |
12 | using System.Text; | | 12 | using System.Text; |
13 | using System.Collections; | | 13 | using System.Collections; |
14 | using FlickrNet; | | 14 | using FlickrNet; |
| @@ -34,27 +34,27 @@ Make it compile with newer flickrnet | | | @@ -34,27 +34,27 @@ Make it compile with newer flickrnet |
34 | licenses = flickr.PhotosLicensesGetInfo(); | | 34 | licenses = flickr.PhotosLicensesGetInfo(); |
35 | } catch (FlickrNet.FlickrApiException e ) { | | 35 | } catch (FlickrNet.FlickrApiException e ) { |
36 | - Log.Error (e.Code + ": " + e.Verbose ); | | 36 | - Log.Error (e.Code + ": " + e.Verbose ); |
37 | + Log.Error (e.Code + ": " + e.Message ); | | 37 | + Log.Error (e.Code + ": " + e.Message ); |
38 | return null; | | 38 | return null; |
39 | } | | 39 | } |
40 | } | | 40 | } |
41 | - return licenses.LicenseCollection; | | 41 | - return licenses.LicenseCollection; |
42 | + return licenses; | | 42 | + return licenses; |
43 | } | | 43 | } |
44 | | | 44 | |
45 | public ArrayList Search (string[] tags, int licenseId) | | 45 | public ArrayList Search (string[] tags, int licenseId) |
46 | { | | 46 | { |
47 | + var options = new PhotoSearchOptions { Tags = tags.Aggregate((a, b) => a += b + " ") }; | | 47 | + var options = new PhotoSearchOptions { Tags = tags.Aggregate((a, b) => a + " " + b) }; |
48 | ArrayList photos_url = new ArrayList (); | | 48 | ArrayList photos_url = new ArrayList (); |
49 | // Photos photos = flickr.PhotosSearchText (tags, licenseId); | | 49 | // Photos photos = flickr.PhotosSearchText (tags, licenseId); |
50 | - Photos photos = flickr.PhotosSearch (tags); | | 50 | - Photos photos = flickr.PhotosSearch (tags); |
51 | + PhotoCollection photos = flickr.PhotosSearch (options); | | 51 | + PhotoCollection photos = flickr.PhotosSearch (options); |
52 | | | 52 | |
53 | if (photos != null) { | | 53 | if (photos != null) { |
54 | - foreach (FlickrNet.Photo photo in photos.PhotoCollection) { | | 54 | - foreach (FlickrNet.Photo photo in photos.PhotoCollection) { |
55 | + foreach (FlickrNet.Photo photo in photos) { | | 55 | + foreach (FlickrNet.Photo photo in photos) { |
56 | photos_url.Add (photo.ThumbnailUrl); | | 56 | photos_url.Add (photo.ThumbnailUrl); |
57 | } | | 57 | } |
58 | } | | 58 | } |
59 | @@ -93,11 +95,14 @@ | | 59 | @@ -93,11 +95,14 @@ |
60 | | | 60 | |