summaryrefslogtreecommitdiff
path: root/src/download.c
diff options
context:
space:
mode:
authorNick White <arch@njw.me.uk>2008-04-03 00:42:00 +0000
committerNick White <arch@njw.me.uk>2008-04-03 00:42:00 +0000
commitf85c3b947985ad0cdaec0197dea8e077c9d5f6d7 (patch)
treef23d297e2265505f4aa53ae07ca3008d9b36d256 /src/download.c
parentb37c74e3fa320ffd23e31c10954243280f7d127d (diff)
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
Diffstat (limited to 'src/download.c')
-rw-r--r--src/download.c45
1 files changed, 0 insertions, 45 deletions
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);
-}