summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/itdb_itunesdb.c51
2 files changed, 31 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index e3647ad..c34c658 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,10 @@
* src/itdb_itunesdb.c: make calls to utf16_strlen()
unnecessary. Thanks to Javier Kohen for the patch.
+ * src/itdb_itunesdb (itdb_parse): don't call
+ ipod_parse_artwork_db() if iTunesDB was not read successfully.
+
+
2007-08-07 Nicholas Piper <nicholas at users.sourceforge.net>
* bindings/python/gpod.i.in: Return an integer for time_t (note,
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index b6b0cab..e6160e1 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -2937,33 +2937,36 @@ Itdb_iTunesDB *itdb_parse (const gchar *mp, GError **error)
itdb_set_mountpoint (itdb, mp);
itdb->filename = filename;
success = itdb_parse_internal (itdb, error);
- if (!success) {
+ if (success)
+ {
+ /* We don't test the return value of ipod_parse_artwork_db
+ * since the database content will be consistent even if
+ * we fail to get the various thumbnails, we ignore the
+ * error since older ipods don't have thumbnails.
+
+ * FIXME: this probably should go into itdb_parse_file,
+ * but I don't understand its purpose, and
+ * ipod_parse_artwork_db needs the mountpoint field from
+ * the itdb, which may not be available in the other
+ * function
+
+ * JCS: itdb_parse_file is used to read local repositories
+ * (usually repositories stored in
+ * ~/.gtkpod). ipod_parse_artwork_db (and the
+ * corresponding artbook write function) should probably
+ * be expanded to look for (write) the required files into
+ * the same directory as itdb->filename in case
+ * itdb->mountpoint does not exist. Because several local
+ * repositories may exist in the same directory, the names
+ * should be modified by the repository name.
+ */
+ ipod_parse_artwork_db (itdb);
+ }
+ else
+ {
itdb_free (itdb);
itdb = NULL;
}
- /* We don't test the return value of ipod_parse_artwork_db
- * since the database content will be consistent even if
- * we fail to get the various thumbnails, we ignore the
- * error since older ipods don't have thumbnails.
-
- * FIXME: this probably should go into itdb_parse_file,
- * but I don't understand its purpose, and
- * ipod_parse_artwork_db needs the mountpoint field from
- * the itdb, which may not be available in the other
- * function
-
- * JCS: itdb_parse_file is used to read local repositories
- * (usually repositories stored in
- * ~/.gtkpod). ipod_parse_artwork_db (and the
- * corresponding artbook write function) should probably
- * be expanded to look for (write) the required files into
- * the same directory as itdb->filename in case
- * itdb->mountpoint does not exist. Because several local
- * repositories may exist in the same directory, the names
- * should be modified by the repository name.
- */
- ipod_parse_artwork_db (itdb);
-
}
}
else