summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2005-10-25 14:51:10 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2005-10-25 14:51:10 +0000
commitc2e1d273b12a7e73954d892708d8736c00cfc277 (patch)
tree6bbbc47508c217551c955abaeef923ef09570766
parent8e1d750e2151906046d4796bc1aa87c3c8a06960 (diff)
downloadlibgpod-tmz-c2e1d273b12a7e73954d892708d8736c00cfc277.tar.gz
libgpod-tmz-c2e1d273b12a7e73954d892708d8736c00cfc277.tar.xz
libgpod-tmz-c2e1d273b12a7e73954d892708d8736c00cfc277.zip
* itdb_itunesdb.c (itdb_parse): added comment, check for itdb
before calling ipod_pars_artwork_db() * db-artwork_parser.c (ipod_parse_artwork_db): added assertion to avoid segfault if called NULL parameter. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1129 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--ChangeLog8
-rw-r--r--src/db-artwork-parser.c2
-rw-r--r--src/itdb_itunesdb.c38
3 files changed, 34 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 819ebe3..454db40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-25 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+ * itdb_itunesdb.c (itdb_parse): added comment, check for itdb
+ before calling ipod_pars_artwork_db()
+
+ * db-artwork_parser.c (ipod_parse_artwork_db): added assertion
+ to avoid segfault if called NULL parameter.
+
2005-10-24 Christophe Fergeau <teuf@gnome.org>
* (itdb_write): remove mountpoint as parameter as not used.
diff --git a/src/db-artwork-parser.c b/src/db-artwork-parser.c
index 2b05eaa..4ec007e 100644
--- a/src/db-artwork-parser.c
+++ b/src/db-artwork-parser.c
@@ -429,6 +429,8 @@ ipod_parse_artwork_db (Itdb_iTunesDB *db)
DBParseContext *ctx;
char *filename;
+ g_return_val_if_fail (db, -1);
+
ctx = NULL;
filename = ipod_db_get_artwork_db_path (db->mountpoint);
if (filename == NULL) {
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index 7405f39..06a94f9 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -1,4 +1,4 @@
-/* Time-stamp: <2005-10-16 01:28:35 jcs>
+/* Time-stamp: <2005-10-25 23:49:43 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -2298,21 +2298,31 @@ Itdb_iTunesDB *itdb_parse (const gchar *mp, GError **error)
if (itdb)
{
itdb->mountpoint = g_strdup (mp);
+
+ /* 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);
}
g_free (filename);
-
- /* 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
- */
- ipod_parse_artwork_db (itdb);
-
-
}
else
{