summaryrefslogtreecommitdiffstats
path: root/bindings/python/gpod.i.in
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/python/gpod.i.in')
-rw-r--r--bindings/python/gpod.i.in19
1 files changed, 12 insertions, 7 deletions
diff --git a/bindings/python/gpod.i.in b/bindings/python/gpod.i.in
index 4ac7e20..9960002 100644
--- a/bindings/python/gpod.i.in
+++ b/bindings/python/gpod.i.in
@@ -56,6 +56,7 @@ version = '.'.join(map(str, version_info))
#include "itdb.h"
#include "itdb_device.h"
#include "itdb_private.h"
+#include "itdb_thumb.h"
#include <time.h>
#include <datetime.h>
#ifdef HAVE_GDKPIXBUF
@@ -82,7 +83,7 @@ PyObject* sw_get_photoalbums(Itdb_PhotoDB *db);
PyObject* sw_get_photoalbum(GList *list, gint index);
PyObject* sw_get_photos(Itdb_PhotoDB *db);
PyObject* sw_get_photo(GList *list, gint index);
-PyObject* sw_get_artwork_thumbnails(Itdb_Artwork *artwork);
+PyObject* sw_get_artwork_thumbnails(Itdb_PhotoDB *db, Itdb_Artwork *artwork);
PyObject* sw_get_photoalbum_members(Itdb_PhotoAlbum *album);
PyObject* sw_ipod_device_to_dict(Itdb_Device *device);
void sw__track_extra_destroy (PyObject *data);
@@ -208,12 +209,15 @@ SWIGTYPE_p__Itdb_PhotoAlbum, 0));
return list;
}
- PyObject* sw_get_artwork_thumbnails(Itdb_Artwork *artwork) {
+ PyObject* sw_get_artwork_thumbnails(Itdb_PhotoDB *db, Itdb_Artwork *artwork) {
PyObject *list;
gint i;
- GList *l;
- list = PyList_New(g_list_length(artwork->thumbnails));
- for (l = artwork->thumbnails, i = 0; l; l = l->next, ++i) {
+ GList *l, *thumbnails;
+ Itdb_Thumb_Ipod *thumb;
+ thumb = (Itdb_Thumb_Ipod *)artwork->thumbnail;
+ thumbnails = itdb_thumb_ipod_to_pixbufs (db->device, thumb);
+ list = PyList_New(g_list_length(thumbnails));
+ for (l = thumbnails, i = 0; l; l = l->next, ++i) {
PyList_SET_ITEM(list, i, SWIG_NewPointerObj((void*)(l->data), SWIGTYPE_p__Itdb_Thumb, 0));
}
return list;
@@ -489,7 +493,8 @@ typedef int gint;
#ifdef HAVE_PYGOBJECT
%typemap(out) gpointer itdb_artwork_get_pixbuf {
$result = pygobject_new((GObject *)$1);
- g_object_unref($1);
+ if ($1)
+ g_object_unref($1);
}
%typemap(in) gpointer pixbuf {
@@ -515,7 +520,7 @@ PyObject* sw_get_photoalbum(GList *list, gint index);
PyObject* sw_get_photos(Itdb_PhotoDB *db);
PyObject* sw_get_photo(GList *list, gint index);
PyObject* sw_get_photoalbum_members(Itdb_PhotoAlbum *album);
-PyObject* sw_get_artwork_thumbnails(Itdb_Artwork *artwork);
+PyObject* sw_get_artwork_thumbnails(Itdb_PhotoDB *db, Itdb_Artwork *artwork);
PyObject* sw_ipod_device_to_dict(Itdb_Device *device);
%include "@top_srcdir@/src/itdb.h"