diff options
| author | jcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2005-12-04 05:27:13 +0000 |
|---|---|---|
| committer | jcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2005-12-04 05:27:13 +0000 |
| commit | 958cf5cbff54fa158d970a6a5848dcd14b970cda (patch) | |
| tree | 193971631e52cba1b26900fb5ecd0bd7ea4248c2 /src/db-artwork-parser.c | |
| parent | e03c3be3b62ad75240b9edac20aab403faf84956 (diff) | |
* src/db-artwork-writer/parser.c: Create ArtworkDB when it does
not exist.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1183 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/db-artwork-parser.c')
| -rw-r--r-- | src/db-artwork-parser.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/db-artwork-parser.c b/src/db-artwork-parser.c index 6796bbe..2709e42 100644 --- a/src/db-artwork-parser.c +++ b/src/db-artwork-parser.c @@ -438,8 +438,24 @@ parse_mhfd (DBParseContext *ctx, Itdb_iTunesDB *db, GError **error) G_GNUC_INTERNAL char * ipod_db_get_artwork_db_path (const char *mount_point) { + gchar *filename; const char *paths[] = {"iPod_Control", "Artwork", "ArtworkDB", NULL}; - return itdb_resolve_path (mount_point, paths); + filename = itdb_resolve_path (mount_point, paths); + + /* itdb_resolve_path() only returns existing paths */ + if (!filename) + { + gchar *path; + paths[2] = NULL; + path = itdb_resolve_path (mount_point, (const char **)paths); + if (path) + { + filename = g_build_filename (path, "ArtworkDB", NULL); + } + g_free (path); + } + + return filename; } @@ -492,7 +508,11 @@ ipod_parse_artwork_db (Itdb_iTunesDB *db) filename = ipod_db_get_artwork_db_path (db->mountpoint); if (filename == NULL) { goto error; - } + } + if (!g_file_test (filename, G_FILE_TEST_EXISTS)) + { + goto error; + } ctx = db_parse_context_new_from_file (filename); g_free (filename); if (ctx == NULL) { |
