From f85c3b947985ad0cdaec0197dea8e077c9d5f6d7 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 3 Apr 2008 00:42:00 +0000 Subject: Removed all media handling code This patch has no new features. It just removes all of the media handling code. It was proving too hard to maintain, and lots of it is now available at the website anyway. git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-34 --- src/download.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'src/download.c') diff --git a/src/download.c b/src/download.c index cddf0de..a1853f5 100644 --- a/src/download.c +++ b/src/download.c @@ -184,48 +184,3 @@ void downloadissue(CURL *curl_handle, char * directory, iss * issue, int force) save_file(curl_handle, cur_section->uri, filename); } } - -void downloadmedia(CURL * curl_handle, char * directory, med * media, int force) -/* Download media pointed to. */ -{ - char newdir[STR_MAX], filename[STR_MAX], fn[STR_MAX]; - FILE * testfile; - - /* for the moment just save to down/media, in future save to issue directories - * (regardless of if they're occupied) */ - snprintf(newdir,STR_MAX,"%s/%s",directory,"media"); - - if(!opendir(newdir)) - if(mkdir(newdir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) - { - printf("Please enter the path of a directory to save media in: "); - scanf("%s", newdir); /* TODO: incorporate GETTEXT */ - } - - /* get the position of the final forwardslash of the uri */ - int slashpos; - for(slashpos=strlen(media->uri); - slashpos>=0 && media->uri[slashpos] != '/'; - slashpos--); - - /* copy from there to fn */ - int tmp; - for(tmp=0, slashpos++; media->uri[slashpos]; tmp++, slashpos++) - fn[tmp] = media->uri[slashpos]; - fn[tmp] = '\0'; - - snprintf(filename,STR_MAX,"%s/%s", newdir, fn); - - if(!force){ - testfile = fopen(filename, "r"); - if(!testfile) - save_file(curl_handle, media->uri, filename); - else - { - fclose(testfile); - printf("Skipping download of media item %s\n", media->title); - } - } - else - save_file(curl_handle, media->uri, filename); -} -- cgit v1.2.3