Same API but now retrieving the album art in threads
[mussorgsky] / src / album_art_panel.py
index cbb7074..bbc338d 100644 (file)
@@ -68,14 +68,15 @@ class MussorgskyAlbumArtPanel (hildon.StackableWindow):
         album = treeview.get_model ().get_value (it, 3)
         artist = treeview.get_model ().get_value (it, 2)
 
-        dialog = AlbumArtSelectionDialog (self, artist, album, 4)
+        dialog = AlbumArtSelectionDialog (self, artist, album, 5)
         dialog.show_all ()
         
         response = dialog.run ()
         if (response > -1):
             (img, thumb) = dialog.get_selection ()
-            pixbuf = gtk.gdk.pixbuf_new_from_file_at_size (thumb, 64, 64)
-            treeview.get_model ().set (it, 1, pixbuf)
+            if img and thumb:
+                pixbuf = gtk.gdk.pixbuf_new_from_file_at_size (thumb, 64, 64)
+                treeview.get_model ().set (it, 1, pixbuf)
         dialog.destroy ()
             
 if __name__ == "__main__":