summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/ithumb-writer.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ea2cc8..80a1bdf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-12-06 Jorg Schuler <jcsjcs at users.sourceforge.net>
+ * src/ithumb-writer.c: create Artwork directory when attempting to
+ write to it.
+
+2005-12-06 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
* src/itdb_itunesdb.c: change g_assert to g_return_if_fail (don't
terminate the application just because the iTunesDB was
manipulated).
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);