Poster downloading update
[cinaest] / src / movie-window.vala
index bb92083..a4433b9 100644 (file)
@@ -43,29 +43,6 @@ public class MovieWindow : StackableWindow {
                // Poster
                image = new Image ();
 
-               if (movie.poster != null && movie.poster.large != null) {
-                       image.pixbuf = movie.poster.large;
-               } else {
-                       if (movie.poster != null && movie.poster.small != null) {
-                               // FIXME
-                               image.pixbuf = movie.poster.small.scale_simple (288, 400, Gdk.InterpType.BILINEAR);
-                       } else {
-                               // FIXME
-                               if (no_poster == null) try {
-                                       no_poster = new Gdk.Pixbuf.from_file ("/usr/share/icons/hicolor/64x64/hildon/general_no_thumbnail.png");
-                               } catch (Error e) {
-                                       critical ("Missing general_no_thumbnail icon: %s\n", e.message);
-                               }
-                               image.pixbuf = no_poster;
-                       }
-                       try {
-                               poster_factory = MoviePoster.Factory.get_instance ();
-                               poster_factory.queue (movie, receive_poster);
-                       } catch (Error e) {
-                               warning ("Failed to queue poster request: %s\n", e.message);
-                       }
-               }
-
                title_label = new Label (title_label_markup (movie));
                title_label.wrap = true;
                title_label.use_markup = true;
@@ -115,6 +92,29 @@ public class MovieWindow : StackableWindow {
                menu.movie_deleted.connect (() => { destroy (); });
                Gdk.Screen.get_default ().size_changed.connect (on_orientation_changed);
                movie.notify.connect (this.on_movie_changed);
+
+               if (movie.poster != null && movie.poster.large != null) {
+                       image.pixbuf = movie.poster.large;
+               } else {
+                       if (movie.poster != null && movie.poster.small != null) {
+                               // FIXME
+                               image.pixbuf = movie.poster.small.scale_simple (288, 400, Gdk.InterpType.HYPER);
+                       } else {
+                               // FIXME
+                               if (no_poster == null) try {
+                                       no_poster = new Gdk.Pixbuf.from_file ("/usr/share/icons/hicolor/64x64/hildon/general_no_thumbnail.png");
+                               } catch (Error e) {
+                                       critical ("Missing general_no_thumbnail icon: %s\n", e.message);
+                               }
+                               image.pixbuf = no_poster;
+                       }
+                       try {
+                               poster_factory = MoviePoster.Factory.get_instance ();
+                               poster_factory.queue (movie, 288, 400, false, receive_poster);
+                       } catch (Error e) {
+                               warning ("Failed to queue poster request: %s\n", e.message);
+                       }
+               }
        }
 
        private void update_title (Movie movie) {