From 4f3c526dcdf5fce74dd12be1c882f6c47d1829ec Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 4 Jun 2014 21:45:12 +0900 Subject: Support PREF_DIR change for Metalink files Reworked previous commit adeead6f0396e2f8551d1182972e277728fd6c8b, and now support changing PREF_DIR for Metalink downloads. --- src/HttpResponseCommand.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/HttpResponseCommand.cc') diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 34ae1cc8..9e9477ab 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -249,8 +249,11 @@ bool HttpResponseCommand::executeInternal() int64_t totalLength = httpResponse->getEntityLength(); fe->setLength(totalLength); if (fe->getPath().empty()) { - fe->setPath(util::createSafePath(getOption()->get(PREF_DIR), - httpResponse->determineFilename())); + auto suffixPath = + util::createSafePath(httpResponse->determineFilename()); + + fe->setPath(util::applyDir(getOption()->get(PREF_DIR), suffixPath)); + fe->setSuffixPath(suffixPath); } fe->setContentType(httpResponse->getContentType()); grp->preDownloadProcessing(); -- cgit