소스 검색

Fix downloaded metaurl torrent filename

Tatsuhiro Tsujikawa 9 년 전
부모
커밋
3c637fa3d5
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      src/Metalink2RequestGroup.cc
  2. 3 1
      src/RequestGroup.cc

+ 1 - 0
src/Metalink2RequestGroup.cc

@@ -228,6 +228,7 @@ void Metalink2RequestGroup::createRequestGroup(
         // make it in-memory download
         torrentRg->addPreDownloadHandler(
             download_handlers::getMemoryPreDownloadHandler());
+        torrentRg->markInMemoryDownload();
         groups.push_back(torrentRg);
       }
     }

+ 3 - 1
src/RequestGroup.cc

@@ -1148,7 +1148,9 @@ std::shared_ptr<DownloadResult> RequestGroup::createDownloadResult() const
 void RequestGroup::reportDownloadFinished()
 {
   A2_LOG_NOTICE(fmt(MSG_FILE_DOWNLOAD_COMPLETED,
-                    downloadContext_->getBasePath().c_str()));
+                    inMemoryDownload()
+                        ? getFirstFilePath().c_str()
+                        : downloadContext_->getBasePath().c_str()));
   uriSelector_->resetCounters();
 #ifdef ENABLE_BITTORRENT
   if (downloadContext_->hasAttribute(CTX_ATTR_BT)) {