Poster downloading update
[cinaest] / src / poster / google-poster-downloader.vala
index b251bc5..97b0a1f 100644 (file)
@@ -73,18 +73,18 @@ public class GooglePosterDownload : Object {
        private string cache_filename;
        private bool cancelled = false;
 
-       public GooglePosterDownload (string title, string year, bool thumbnail, int _handle, GooglePosterDownloader _downloader) {
+       public GooglePosterDownload (string title, string year, int width, int height, int _handle, GooglePosterDownloader _downloader) {
                var search = title + "+" + year + "+movie+poster";
 
                handle = _handle;
                downloader = _downloader;
                session = downloader.session;
 
-               var message = new GoogleImageSearch (search, thumbnail);
+               var message = new GoogleImageSearch (search, (width < 128 && height < 128));
                message.got_poster_uri.connect (on_got_poster_uri);
                session.queue_message (message, google_search_finished);
 
-               if (thumbnail) {
+               if (width < 128 && height < 128) {
                        // FIXME
                        cache_dir = Path.build_filename (Environment.get_tmp_dir(), "cinaest-thumbnails");
                } else {
@@ -179,16 +179,8 @@ public class GooglePosterDownloader : Object, PosterDownloader {
        }
 
        // Implement the PosterDownloader interface
-       public int Fetch (string title, string year, string kind) throws DBus.Error {
-               var download = new GooglePosterDownload (title, year, false, ++fetch_handle, this);
-
-               downloads.append (download);
-
-               return fetch_handle;
-       }
-
-       public int FetchThumbnail (string title, string year, string kind) throws DBus.Error {
-               var download = new GooglePosterDownload (title, year, true, ++fetch_handle, this);
+       public int Fetch (string title, string year, string kind, int width, int height) throws DBus.Error {
+               var download = new GooglePosterDownload (title, year, width, height, ++fetch_handle, this);
 
                downloads.append (download);