Movie list view: add poster view mode, shows a 5x2 poster grid
[cinaest] / src / movie-window.vala
index 0aef805..82a2511 100644 (file)
@@ -41,13 +41,13 @@ public class MovieWindow : StackableWindow {
                // Poster
                image = new Image ();
 
-               if (movie.poster != null && movie.poster.pixbuf != null) {
-                       image.pixbuf = movie.poster.pixbuf;
+               if (movie.poster != null && movie.poster.large != null) {
+                       image.pixbuf = movie.poster.large;
                } else {
                        movie.notify.connect (this.on_movie_changed);
-                       if (movie.poster != null && movie.poster.thumbnail != null) {
+                       if (movie.poster != null && movie.poster.icon != null) {
                                // FIXME
-                               image.pixbuf = movie.poster.thumbnail.scale_simple (268, 424, Gdk.InterpType.BILINEAR);
+                               image.pixbuf = movie.poster.icon.scale_simple (268, 424, Gdk.InterpType.BILINEAR);
                        } else {
                                // FIXME
                                if (no_poster == null) try {
@@ -123,17 +123,19 @@ public class MovieWindow : StackableWindow {
        private void receive_poster (Gdk.Pixbuf pixbuf, Movie movie) {
                var poster = new Poster();
 
-               poster.pixbuf = pixbuf;
-               if (movie.poster != null)
-                       poster.thumbnail = movie.poster.thumbnail;
+               poster.large = pixbuf;
+               if (movie.poster != null) {
+                       poster.icon = movie.poster.icon;
+                       poster.small = movie.poster.small;
+               }
                movie.poster = poster;
        }
 
        private void on_movie_changed (GLib.Object source, GLib.ParamSpec spec) {
                var movie = (Movie) source;
 
-               if ((spec.name == "poster") && (movie.poster != null) && (movie.poster.pixbuf != null)) {
-                       image.pixbuf = movie.poster.pixbuf;
+               if ((spec.name == "poster") && (movie.poster != null) && (movie.poster.large != null)) {
+                       image.pixbuf = movie.poster.large;
                }
        }