summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2007-06-01 14:19:21 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2007-06-01 14:19:21 +0000
commit90b4b4282da5380c6a756d3f2c10a66e96115859 (patch)
tree9a5bf92348e86b28d97613adba5093d5882ae545
parent5563bf9adbb046cb6a99d8653606af8c735cb115 (diff)
downloadlibgpod-90b4b4282da5380c6a756d3f2c10a66e96115859.tar.gz
libgpod-90b4b4282da5380c6a756d3f2c10a66e96115859.tar.xz
libgpod-90b4b4282da5380c6a756d3f2c10a66e96115859.zip
* src/itdb_photoalbum.c (itdb_photodb_parse): return a valid
photodb structure including the main Photo Library album if no database existed, analogous to itdb_photodb_create(). Without this the test-photos script won't work as expected and other applications also would have to add extra checks for presence of the main Photo Libarary. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1515 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--ChangeLog7
-rw-r--r--src/itdb_photoalbum.c13
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 307c361..39ee960 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,13 @@
src/db-itunes-parser.h: '#if 0' unused structure to avoid
confusion.
+ * src/itdb_photoalbum.c (itdb_photodb_parse): return a valid
+ photodb structure including the main Photo Library album if no
+ database existed, analogous to itdb_photodb_create(). Without
+ this the test-photos script won't work as expected and other
+ applications also would have to add extra checks for presence of
+ the main Photo Libarary.
+
2007-05-30 Todd Zullinger <tmzullinger at users.sourceforge.net>
* bindings/python/tests/resources/iTunes/iTunesDB.ext
diff --git a/src/itdb_photoalbum.c b/src/itdb_photoalbum.c
index 6e291c6..714446e 100644
--- a/src/itdb_photoalbum.c
+++ b/src/itdb_photoalbum.c
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-01-15 01:02:46 jcs>
+/* Time-stamp: <2007-06-01 23:03:58 jcs>
|
| Copyright (C) 2002-2006 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -24,7 +24,7 @@
|
| This product is not supported/written/published by Apple!
|
-| $Id$
+| $Id: itdb_photoalbum.c,v 1.17 2007/03/21 08:37:20 jcsjcs Exp $
*/
#include <config.h>
@@ -224,6 +224,15 @@ Itdb_PhotoDB *itdb_photodb_parse (const gchar *mp, GError **error)
photodb = itdb_photodb_new ();
itdb_device_set_mountpoint (photodb->device, mp);
ipod_parse_photo_db (photodb);
+
+ /* if photodb is empty, create a valid photodb including the main
+ Photo Library album */
+ if (!photodb->photos && !photodb->photoalbums)
+ {
+ itdb_photodb_free (photodb);
+ photodb = itdb_photodb_create (mp);
+ }
+
return photodb;
}