From f8ab052c689bc2fa4272503bc19889b938eacb1a Mon Sep 17 00:00:00 2001 From: Jorg Schuler Date: Fri, 9 Dec 2005 14:54:58 +0000 Subject: * src/ithumb-writer.c: create Artwork directory when attempting to write to it. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1189 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- ChangeLog | 5 +++++ src/ithumb-writer.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5ea2cc8..80a1bdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-12-06 Jorg Schuler + + * src/ithumb-writer.c: create Artwork directory when attempting to + write to it. + 2005-12-06 Jorg Schuler * src/itdb_itunesdb.c: change g_assert to g_return_if_fail (don't diff --git a/src/ithumb-writer.c b/src/ithumb-writer.c index d354c32..1975e34 100644 --- a/src/ithumb-writer.c +++ b/src/ithumb-writer.c @@ -120,6 +120,15 @@ ipod_image_get_ithmb_filename (const char *mount_point, gint correlation_id, gin gchar *path; paths[2] = NULL; path = itdb_resolve_path (mount_point, (const char **)paths); + if (path == NULL) + { /* attempt to create directory */ + gchar *pth = g_build_filename (mount_point, + paths[0], path[1], NULL); + mkdir (pth, 0777); + g_free (pth); + path = itdb_resolve_path (mount_point, + (const char **)paths); + } if (path) { filename = g_build_filename (path, buf, NULL); -- cgit