From 4293482bf03bfda2dcc8929d1b5ed5efff1456e2 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Fri, 18 Aug 2006 03:00:47 +0000 Subject: create the playlist directory instead of warning it doesnt exist when entering the playlist cataloge git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10640 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist_catalog.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'apps/playlist_catalog.c') diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c index 55af178ee4..87034aad3b 100644 --- a/apps/playlist_catalog.c +++ b/apps/playlist_catalog.c @@ -111,14 +111,20 @@ static int initialize_catalog(void) if (!playlist_dir_exists) { - gui_syncsplash(HZ*2, true, str(LANG_CATALOG_NO_DIRECTORY), - playlist_dir); - return -1; + if (mkdir(playlist_dir, 0) < 0) { + gui_syncsplash(HZ*2, true, str(LANG_CATALOG_NO_DIRECTORY), + playlist_dir); + return -1; + } + else { + playlist_dir_exists = true; + memset(most_recent_playlist, 0, sizeof(most_recent_playlist)); + initialized = true; + } } return 0; } - /* Use the filetree functions to retrieve the list of playlists in the directory */ static int create_playlist_list(char** playlists, int num_items, -- cgit v1.2.3