summaryrefslogtreecommitdiffstats
path: root/src/ithumb-writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ithumb-writer.c')
-rw-r--r--src/ithumb-writer.c9
1 files changed, 9 insertions, 0 deletions
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);